شرح صفوف ومحتوى الفقرة
rangeOverflow
استخدمنا الخاصية في التحقق من ان القيمة المدخلة اكبر من ال 100 او لا
HTML
<input id="id1" type="number" max="100">
<button onclick="myFunction()">OK</button>
<p id="demo"></p>
<script>
function myFunction() {
let text = "Value OK";
if (document.getElementById("id1").validity.rangeOverflow) {
text = "Value too large";
}
}
</script>
rangeUnderflow
استخدمنا الخاصية في التحقق من ان القيمة المدخلة اقل من ال 100 او لا
HTML
<input id="id1" type="number" min="100">
<button onclick="myFunction()">OK</button>
<p id="demo"></p>
<script>
function myFunction() {
let text = = "Value OK";
if (document.getElementById("id1").validity.rangeUnderflow) {
text = "Value too small";
}
}
</script>