0
我很感興趣,如果可以更改佔位符的默認驗證消息。
必須是製作自定義消息的一種方式。需要HTML5佔位符 - 更改默認消息
我的形式:
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>HTML5 Placeholder</title>
</head>
<body>
<form>
<input type="text" id="email" maxlength="35" placeholder="E-mail" required>
<button type="submit">Ok</button>
</form>
</body>
</html>
我試着用JavaScript但消息apears每次:HTML5的形式要求的屬性的
<script type="text/javascript">
document.getElementById('email').setCustomValidity('Please enter your e-mail!');
</script>
可能重複。設置自定義驗證消息?](http://stackoverflow.com/questions/5272433/html5-form-required-attribute-set-custom-validation-message) – djf