[英]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. 我的代码上出现语法错误,对于战舰游戏,输入应大于0且小于11。
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
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.