是否可以更改我们添加到HTML中元素的属性required
的默认值?
例如:
<form action="" method="post">
<input type="email" name="signup-email" id="signup-email" placeholder="enter your email address" required />
<input type="submit" value="Notify Me" />
</form>
答案 0 :(得分:-1)
我相信你提供的HTML代码块应该如下:
<form action="" method="post">
<input type="email" name="signup-email" id="signup-email" placeholder="enter your email address" required="required" />
<input type="submit" value="Notify Me" />
</form>
如果你想完全删除它:
<form action="" method="post">
<input type="email" name="signup-email" id="signup-email" placeholder="enter your email address" />
<input type="submit" value="Notify Me" />
</form>
显然,由于表单的ACTION属性中没有URL地址,表单将POST回自身(即表示托管在其上的页面,因此如果它位于您的contact.aspx表单上,它将回发联系.aspx)