Я учусь на экзамен, и я сам делаю некоторые пробные проблемы. Я столкнулся с Uncaught TypeError: document.getElementByID не является проблемой функции.document.getElementByID не функция Быстрое исправление
Вот мой код:
<script>
function checkValidity(){
//Create variable to check for errors
var input = document.getElementByID('myID').value;
if(input < 0){
document.getElementByID('errorCheck').textContent = 'The value must be a positive integer';
}else if(ifNaN(input)){
document.getElementByID('errorCheck').textContent = 'Not a number. The value must be a positive integer.';
}else if(input == null){
document.getElementByID('errorCheck').textContent = 'Please input a value.';
} else{
document.getElementByID('errorCheck').textContent = 'Valid number.';
}
}
document.getElementByID('validateid').onclick = checkValidity;
Он кричит на меня в этой строке кода говорят, что это недопустимо.
document.getElementByID('validateid').onclick = checkValidity;
Я знаю его небольшую ошибку. Я был бы признателен, если бы кто-нибудь это указал.
'isNaN', not'ifNaN'. – 1252748