javascript - JQuery On Click -
i can' quite figure out how attach jquery function div. now, want able click div, , have jquery pop , tell me clicked. of now, nothing happens when click div.
<div id="yahoologin" name="yahoologin"> <input type="submit" value="" name="submit" /> </div>
my jquery in separate file:
$('#yahoologin').on('click',(function() { alert("you clicked it!"); });
does jquery need in same file?
when run this:
$(document).ready(function () { alert("hi"); });
it works, know i'm linking right page.
click function should inside ready function
$(document).ready(function () { $('#yahoologin').on('click',(function() { alert("you clicked it!"); }); });
Comments
Post a Comment