我有一个错误,我无法找到解决方案,我没有使用jQuery;我没有任何分度,提交姓名类型错误:的document.getElementById(...)提交不是一个函数
我的代码是
<!DOCTYPE html>
<html>
<head>
<script>
function formSubmit()
{
document.getElementById('web').submit();
}
</script>
</head>
<body>
<form action="class003.php" id="g_form" method="POST">
<input type="text" name="f1" value="">
</form>
<div id="web" onclick="formSubmit()">click</div>
</body>
</html>
上CHROM我在Firefox相同收到此错误
Uncaught TypeError: document.querySelector(...).submit is not a function at formSubmit (test2.html:8) at HTMLDivElement.onclick (test2.html:19)
错误
TypeError: document.getElementById(...).submit is not a function[Learn More]