isNaN

const element = document.getElementById(‘myBtn’); element.addEventListener(‘click’, myFunction);
function myFunction() { const nan = document.getElementById(‘is-nan’).value; document.getElementById(‘nan-result’).innerHTML = isNaN(nan)

isNaN method returns true if a value is Not-a-Numner

Example


Similar Posts

  • Canvas

    The canvas element is a powerful tool for creating graphics and interactive visual elements directly in a web browser. It is a container for drawing graphics using JavaScript. Unlike traditional image elements, the canvas element is dynamic, allowing developers to draw, manipulate, and animate content programmatically. Key Features of HTML Canvas Drawing Shapes: You can…

One Comment

Leave a Reply

Your email address will not be published. Required fields are marked *