简体   繁体   中英

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

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

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM