<ul>
<li>
<a href='javascript:;' class='close'>close</a>
<a>openId</a>
</li>
</ul>
I want to remove the li element when click a.close.The li is generate dynamic, which means each time a new li was generated, I will do something like this.
$("a.close").unbind("click").click(function(){
console.log("close click");
})
however, it didn't work as expected, when I type $("a.close").click()
in chrome console, it print "close click" as expected, but when I click the a.close area with mouse, it didn't show anything, which means the event didn't trigger.
what is the difference between js's click function and mouce click using hands?