dynamic links with jQuery
hello,
i have a bottun, that each time i press it, it creates a new link on my page that looks like this:
-
<a href="#" class="left" name="del" id="2">clear</a>
this is the JS code that with it i add the link:
-
$("#tagChoosed").html("<p><span class='right' id='"+tagID+"'>"+tagTITLE+"</span><a href='#' class='left' name='del' id='"+tagID+"'>clear</a><br class='br' /></p>");
and in my jQuery i have this code, for handling the new links:
-
$("a[@name='del']").click(function(){
alert("you choosed to delete the dynamic link");
return false;
});
but when i click on the links that were created by JS, nothing happens. it's like jQuery doesn't know they are there