CODE
function addalert(msg){
var count = $("#ac > div").length;
console.log(count);
$("#ac").append("<div id=\"alert["+count+"]\" class = \"alert\">Alert: "+msg+"<d id=\"cloze["+count+"]\"><img src=\"red-x-icon.gif\" width=\"25\" height=\"25\" align\"absmiddle\" /></d>");
console.log("<div id=\"alert["+count+"]\" class = \"alert\">Alert: "+msg+"<d id=\"cloze["+count+"]\"><img src=\"red-x-icon.gif\" width=\"25\" height=\"25\" align\"absmiddle\" /></d>");
console.log("#cloze["+count+"]");
$("#cloze["+count+"]").click(function(){
console.log("niggers!");
$("#alert["+count+"]").slideUp(1000);
});
}
var count = $("#ac > div").length;
console.log(count);
$("#ac").append("<div id=\"alert["+count+"]\" class = \"alert\">Alert: "+msg+"<d id=\"cloze["+count+"]\"><img src=\"red-x-icon.gif\" width=\"25\" height=\"25\" align\"absmiddle\" /></d>");
console.log("<div id=\"alert["+count+"]\" class = \"alert\">Alert: "+msg+"<d id=\"cloze["+count+"]\"><img src=\"red-x-icon.gif\" width=\"25\" height=\"25\" align\"absmiddle\" /></d>");
console.log("#cloze["+count+"]");
$("#cloze["+count+"]").click(function(){
console.log("niggers!");
$("#alert["+count+"]").slideUp(1000);
});
}
I just trial and error'd it for like half an hour, there really isn't much i can change about those 4 lines of code. I debugged it thoroughly, just to make sure, and everything is working exactly as expected, its just not working!