Skip to content

Latest commit

 

History

History
21 lines (15 loc) · 800 Bytes

give_an_example_usage_of_rangeoverflow_property.md

File metadata and controls

21 lines (15 loc) · 800 Bytes

Give an example usage of rangeOverflow property

The rangeOverflow property checks if the value entered in an input field exceeds the maximum value specified by the max attribute.

Example:

<input type="number" id="age" min="18" max="100">
<script>
  const input = document.getElementById('age');
  if (input.validity.rangeOverflow) {
    console.log('Value exceeds the maximum limit!');
  }
</script>

Tags: intermediate, JavaScript, DOM, validation

URL: https://www.tiktok.com/@jsmentoring/photo/7465086711412854048