在jQuery中,
event.target始终指触发事件的元素,其中
event传递给函数的参数在哪里。
$(document).ready(function() { $("a").click(function(event) { alert(event.target.id); });});还请注意,这也
this将起作用,但它不是jQuery对象,因此,如果您希望在其上使用jQuery函数,则必须将其称为
$(this),例如:
$(document).ready(function() { $("a").click(function(event) { // this.append wouldn't work $(this).append(" Clicked"); });});


