I am using jQuery 1.7.1 on my site and using the .live()
function for some events that need to be called on future-added elements. For some reason it is not working (No errors, no alerts, nothing is shown). I have read a little and some people say that it doesn't work, and others say that it works fine but I haven't seen any workarounds, fixes or anything that is even recent. It works fine in other browsers, just not in IE9 (and probably the other IE's).
Is there an alternative to .live in jQuery that I could use, a plugin or some workaround that will fix this?
My current code is as follows:
$('select[name="CourseLevelSelector"] option').live('dblclick', function () {
//Do Stuff
});
-Jake
EDIT:
My aim all in all is that I have 2 multiple select boxes, one that has data in and another that is blank. When you doubleclick on an option in the select box with data in, it will duplicate itself into the empty select. And if you then doubleclick on an option that has been added, it will remove it completely. (This code is working, it's just the event handler that isn't)
HTML looks something along these lines:
<select name="CourseLevelSelector" multiple="multiple">
<option value="1">First</option>
<option value="2">Second</option>
<option value="3">Third</option>
</select>
<select name="CourseLevelIDs" multiple="multiple">
</select>