HTML:
Javascript:
Pass "event" keyword in onclick function and also you pass extra argument after that like
HTML:
Javascript:
Demo:
http://jsfiddle.net/patelriki13/2zuef/
<input type="button" value="click me" onclick="ButtonClick(event);" />
function ButtonClick(e, button) { alert(e.type); alert("Button Click...!"); }
Pass "event" keyword in onclick function and also you pass extra argument after that like
HTML:
<input type="button" value="click me" onclick="ButtonClick(event, this);" />
function ButtonClick(e, button) { alert(e.type); alert("Button Click...!"); }
Demo:
http://jsfiddle.net/patelriki13/2zuef/
No comments:
Post a Comment