admin 管理员组文章数量: 1086019
This is the method:
$(document).ready(function () {
$('btnDelete1').click(function () {
alert("something");
})
});
And this is the code for the button:
<input type="submit" value="Delete Role" disabled="disabled" id="btnDelete1"/>
But whenever I click the button, the alert isn't happening. Why is this?
This is the method:
$(document).ready(function () {
$('btnDelete1').click(function () {
alert("something");
})
});
And this is the code for the button:
<input type="submit" value="Delete Role" disabled="disabled" id="btnDelete1"/>
But whenever I click the button, the alert isn't happening. Why is this?
Share Improve this question edited Jan 16, 2012 at 13:26 Chuck Norris 15.2k15 gold badges95 silver badges127 bronze badges asked Jan 16, 2012 at 13:01 dfgj fghjkdfgj fghjk 411 gold badge2 silver badges7 bronze badges3 Answers
Reset to default 5The problem isn't connected with MVC anyway, you missed #
in Jquery selector only.
$(document).ready(function () {
$('#btnDelete1').click(function () {
alert("something");
});
});
EDIT:
And as mentioned Jeffrey, you forget ;
too
Your selector is wrong
It should be
$(document).ready(function () {
$('#btnDelete1').click(function () {
alert("something");
});
});
Did you forget a ;
?
$(document).ready(function () {
$('#btnDelete1').click(function () {
alert("something");
});
});
本文标签: javascriptButton click event not firing in jQueryStack Overflow
版权声明:本文标题:javascript - Button click event not firing in jQuery - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://roclinux.cn/p/1744001834a2516586.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论