页面上有p
元素。
此p
有2次绑定点击(请保留这一点。我知道还有其他选项。)
$('p').click (function (e) {
e.preventDefault(); //<== not helping me as I thought it should
alert('1');
});
//...later on the same page...
$('p').click (function ( ) {
alert('2');
});
我希望第一个代码阻止执行第二个代码( NOT VIA FLAGS)
这种做法最elegant
的方式是什么?
答案 0 :(得分:6)