Reputation: 11
I am getting a Syntax error on my code where the input should be greater than 0 and less than 11 for a battleship game.
Here is the line of code if anyone has any suggestions it would be much appreciated.
document.getElementById("bullet").elements['bulletX'].value(>0 && <11);
Thank you
Upvotes: 0
Views: 159
Reputation: 4974
var element = document.getElementById("bullet").elements['bulletX'].value;
if(element > 0 && element < 11) {
// do the job
}
Upvotes: 1