简体   繁体   中英

Jquery event handler not firing

I have a web page that is having some javascript issues. I have tried looking over everything however I have a username field and when you click it ( .focus ) it should bring up a pop up. I used firebug in firefox to put break points right then the .focus function is called and it it is not fired even though I do focus on the username field. I have also looked over spelling and everything. Cant seem to find the issue. Hope someone can help. One more thing, this issue is happening in all browsers.

page link: http://aliahealthcareer.com/SignUp

Your page has two inputs with id="username" .

Repeating ids is invalid html, but the browser kind of ignores it except that $('#username') finds only the first one so your .focus() handler is bound to that one.

The first is within the "login_response" div that is hidden until you click the "Login" option, so if you click "Login" and then click the "Username/Email" field that appears you'll see that your event handler runs.

You have JS issues on load of that page. JS wont work properly thereafter. You need to fix those first.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM