[jQuery] Binding Event to Dynamically Created Element (works in FF but not in IE)
I'm in the process of converting standard javascript code to jQuery,
it has already save tons of lines of code and make it more
manageable. I'm a bit stumped to why this works in FF and not in IE
using jQuery bind.
-- Snippets --
var BigBox = {
init : function () {
...
this.loadElements();
...
$('.bigbox_li').bind("dbclick", function(e) {$
(this).addClass("bigbox_li_active")});
},
loadElements : function() {
...
var li = document.createElement("li");
li.setAttribute( "id", "li_" + this.nextCount); // nextCount
ensure uniqueness
li.setAttribute( "class", "bigbox_li");
...
}
}
I did check the DOM in IE using IE Developer toolbar, it does have the
class "bigbox_li) associated with the li html element.
Any help would be great! Spend a few hours on this already!