x
 
<!DOCTYPE html>
<html>
<body>
<form id="myForm" action="/demo/htmldom/action_page.php">
  电邮:<input type="email" name="user_email">
  <input type="submit">
</form>
<p>点击“试一试”按钮可指定上面的表单数据在提交时不进行验证。</p>
<button onclick="myFunction()">试一试</button>
<p id="demo"></p>
<script>
function myFunction() {
  document.getElementById("myForm").noValidate = true;
  document.getElementById("demo").innerHTML = "novalidate 属性现在已被添加到表单元素,表单数据将不会在提交时被验证。";
}
</script>
</body>
</html>