在程序中使用事件对象,jQuery可以这样写:

$("element").bind("click",function(event){

});

停止事件冒泡:

$("span").bind("click",function(){

var txt=$("#msg").html()+"内层元素被单击";

$("#msg").html(txt);

event.stopPropagation();

})