【发布时间】:2011-07-12 08:47:43
【问题描述】:
当点击具有特定属性的特定后代时,我们如何调用特定函数?
我有 html :
<form>
<input type="text" />
<input type="submit" />
</form>
我如何运行这样的东西:
$(document).ready(function(){
$('form').find('input').click(function(){
alert('');
});
});
这个函数只有在我们提交的时候才会被调用。
【问题讨论】:
-
是否要在表单提交时调用函数!
-
是的,完全正确,无需更改 html。
标签: jquery html click descendant