JQuery append not working in Internet Explorer 8

I have a problem with jQuery append only in Internet Explorer 8 (I did not check earlier versions). At startup (in function ready()) I add divto my container div. This does not work in IE8, but the div is not added. I checked this by returning the length of $ ('div # options') in the console. Why is this not working?

This is my code for adding a div:

$('div#container').append('<div id="options"><a href="#" id="delete"><a href="#content" id="edit"></div>');

I also tried to use prepend()and appendTo(), but they did not work either ... Can someone help me?

Thank!

+3
source share
3 answers

Your broken links may be causing the problem.

$('div#container').append('<div id="options"><a href="#" id="delete">Delete</a><a href="#content" id="edit">Edit</a></div>');
+10
source

try it like

 $('#container').append('<div id="options"><a href="#" id="delete">delete</a><a href="#content" id="edit">edit</a></div>');

working demo tested in ie8

+4

IE , DOM . , , . (, )

+1

All Articles