user1388135
user1388135

Reputation: 11

Syntax Error On Google Chrome JavaScript console

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

Answers (1)

Gabriel Santos
Gabriel Santos

Reputation: 4974

var element = document.getElementById("bullet").elements['bulletX'].value;

if(element > 0 && element < 11) {
    // do the job
}

Upvotes: 1

Related Questions