我正在学习javascript。如何在文档准备好提交时绑定(bind)此功能?
jQuery(function($) {
$('form').bind('submit', function() {
$(this).find(':select').removeAttr('disabled');
});
});
谢谢
最佳答案
$(document).ready(function() {
/* your code here */
$('form').bind('submit', function() {
$(this).find(':select').removeAttr('disabled');
});
/* end your code */
});
就这么简单 - 一旦文档“准备好”,绑定(bind)就会就位 - 要获得更多说明,请访问 jQuery 教程网站以获取有关 $(document).ready() 事件的信息: http://learn.jquery.com/using-jquery-core/document-ready/
关于javascript - 文档就绪后提交时的绑定(bind)函数,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24657795/