Is there a way to ‘undo’ functions in jQuery? Let me explain.. I have a function which recreates exactly the select html tag. As you know with a select tag, clicking on a list item select that one, when clicking outside the select tag, the whole dropdown list closes. The selecting works fine, but the closing isn’t. I though this would work with the event.stopPropagation() event object but it doesn’t. Is there any other solution for this?
Is there a way to ‘undo’ functions in jQuery? Let me explain.. I have
Share
There is really nothing like what you are asking for that is built into jQuery natively. You have to do it on your own.
My suggestion would be to bind to the document:
You already have the
stopPropagationthat would prevent this from being triggered when you click the list too.http://jsfiddle.net/cmAtc/1/