I'm very new to javascript and I'm having an issue with this script:
function processInp() {
var x = parseInt(document.querySelector('input[name="num"]').value);
if (!x) {
alert("NaN");
return false
} else if (x > 480) {
alert("Overflow!");
return false
}
window.open("../files/" + x + '.html');
return true
}
First, it checks if the input is a number, then if it is higher than 480, so throw an alert and an error. That's completly fine and working. What I really can't do is opening the url according to the input. Is it possible with numbers? How? Full example if possible. Thank you!