Tho*_*rew -2 javascript syntax
javascript:If(document.getElementById('troop_confirm_go') != null){
alert('true');
return true;
} else{
alert('false');
return false;
}
Run Code Online (Sandbox Code Playgroud)
这个语法有什么问题吗?我试图在一个页面上运行它,但它没有显示任何一个警报,即使我尝试使用不同的按钮等不同的页面.所以我想要运行它的页面没有问题.(我正在通过我的浏览器的URL栏进行测试,并尝试了chrome和firefox,两者都产生相同的结果)