I have been working with jquery for a while so this is quite embarrassing that i’m having issues with this. I created a new element but i can’t select it with jquery, what can i do about this? This is the javascript i used to create the element
$('<div id="test">blah</div>').insertAfter('#ref');
the html is
<html>
<head>
</head>
<body>
<div id="ref"></div>
</body>
</html>
i then tried this
$('#test').click(function(){
$(this).remove();
});
but it does not work… i need help here
1 Answer