我怎样才能完成这样的事情:
function (e) {
if(e.("#this_button_is_clicked").true)
{//then do this}
});
修改
$("body").click
(
function (e) {
if (e.target.className !== cls || e.target.click("#bUpdate")) {
//do this
}
}
);
我有一个文本框,每当我点击其他地方时,它就会触发模糊到那个文本框。但是当我点击按钮看起来它看起来并不像'body.click'所以我只是想在我的条件中添加button.clicked.true
答案 0 :(得分:1)
jQuery事件对象具有target
属性:
if ($(e.target).is("#this_button_is_clicked"))
{
console.log(e);
}