-1
이 입력 확인 예제를 이해하려고하는데 작동하지 않는 것 같습니다. jsfiddle에서 당신이 onLoad
내부 코드를 가지고HTML5 - 양식 입력 검사
HTML
<label>Email:</label>
<input type="email" id="email_addr" name="email_addr">
<label>Repeat Email Address:</label>
<input type="email" id="email_addr_repeat" name="email_addr_repeat" oninput="check(this)">
JS
function check(input) {
if (input.value != document.getElementById('email_addr').value) {
input.setCustomValidity('The two email addresses must match.');
} else {
// input is valid -- reset the error message
input.setCustomValidity('');
}
}
이러한 레이블 요소는 쓸모가 없습니다. 그것들은 입력을 포함하지도 않고'for' 속성도 가지고 있지 않습니다. – Quentin