setTimeout(e.show(200), 1000); should be:
setTimeout("e.show(200);", 1000); or: setTimeout(function() { e.show(200); }, 1000); (line-end semi-colon not necessary, but should be used for good practice) On Oct 6, 7:57 am, Dennis Madsen <den...@demaweb.dk> wrote: > I'm trying to create new DOM and append it to a div. When the div is > appended, I would like it to be shown after 1sec. > > var e = "<div style='display:none;'>content</div>"; > $("#container").append(e); > setTimeout(e.show(200), 1000); > > This code does not work. The HTML is appended but the show-function > does not work. Hope someone can help me.