var myDiv = document.getElementById("div"),
    myInput = document.getElementById("input"),
    theAges = document.getElementById("ages");
//Element.event = function () {// code}
theAges.onchange = function() {
  "use strict";
  myDiv.innerHTML = myInput.value * theAges.value;
  if (myInput.value === isNaN()) {
    myDiv.innerHTML = "this is not a number";
  }
};
            Asked
            
        
        
            Active
            
        
            Viewed 33 times
        
    0
            
            
         
    
    
        adiga
        
- 34,372
- 9
- 61
- 83
 
    
    
        Amr Hendawy
        
- 21
- 7
- 
                    1[How much research effort is expected of Stack Overflow users?](https://meta.stackoverflow.com/a/261593/3082296) – adiga Jun 20 '20 at 13:27
1 Answers
1
            
            
        Try this :
if (isNaN(myInput.value))
isNaN is a function that take in parameter the value you want to test and return a boolean.
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/isNaN
 
    
    
        Arcord
        
- 1,724
- 1
- 11
- 16