【发布时间】:2014-01-08 23:35:01
【问题描述】:
我在 html5 中遇到按钮 type="submit" 或输入 type="submit" 的问题,在 IE 浏览器中检查时按钮操作无效,请提供任何建议。
我的按钮操作在表单标签之外
<form>
my code comes here
</form>
我的按钮应该按照我的要求在外面
<button type="submit"></button>
【问题讨论】:
标签: html
我在 html5 中遇到按钮 type="submit" 或输入 type="submit" 的问题,在 IE 浏览器中检查时按钮操作无效,请提供任何建议。
我的按钮操作在表单标签之外
<form>
my code comes here
</form>
我的按钮应该按照我的要求在外面
<button type="submit"></button>
【问题讨论】:
标签: html
由于您的按钮在 form 标记之外,它不会提交该表单。 为此,您必须使用 jquery 按钮 click event 提交该表单
例如:-
<form id="frm"></form><button type="submit" id="test"></button>
<script>
$( document ).ready(function(){
$("#test").click(function(){
$("#frm").submit();
});
});
</script>
【讨论】: