I have two javascript function in my index.js file saved in the same folder directory as my html file but for some reasons i am able to call only one of the function the second function is not getting called.
index.js
function cond(){ alert('Is the form correct'); } function isNumber(e){ e = e || window.event; var charCode = e.which ? e.which : e.keyCode; return /\d/.test(String.fromCharCode(charCode)); } index.html
<?php require "header.html"?> <label>Year</label> <input type ="number" min="1950" max="2050" name="year" onkeypress="return isNumber(event)" required> <label>school</label> <input type ="text" onclick="cond();" name="school" required> header.html
<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <script src="index.js"></script> </head> <body> <main> Am able to use the isNumber() function successfully but the other function cond() is not getting called when the text is clicked
require.