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

Popular posts from this blog

commonjs - How to write a typescript definition file for a node module that exports a function? -

openid - Okta: Failed to get authorization code through API call -

thorough guide for profiling racket code -