Thursday 15 April 2010

javascript - jquery blur not working on "exiting" text input even though "click" does -


I'm trying to create a custom dropdown that is "tabbed" by using "jquery", it is < Code> ul , and I would like the text input directly above it, when there must be some difference on ul . But for some reason it

  var input = $ ("ul.dropdown_ul"). Prev ("Input"); $ ("# Container"). On ("blurred", input, function () {warning ("test");});   

Click the click as the event does not work, fire the alert. But Blurring is not working.

Why does not this work but any thoughts? Thank you.

Your # container is a div normally used on haze input, so why it works The following functions do not work properly.

  $ ("# container input"). On ("blur", function () {warning ("test");});   

Updates about the comment:

If you are looking for a specific element then on the blurred event. Just make sure you choose it properly and apply the listener to it. I think this is what you are trying to accomplish.

  var $ input = $ ("ul.dropdown_ul"). Prev ('input') $ input.on ("blur" function () {warning ("test");});   



No comments:

Post a Comment