<div class="htmlarea"> <textarea id="runcode96053"> <script> a=0 if(a<1)alert(a),alert(1-a) //VS if(a==0){alert(a);alert(1-a)} </script> </textarea><br><input onclick="runEx('runcode96053')" type="button" value="运行代码"> <input onclick="doCopy('runcode96053')" type="button" value="复制代码"> <input onclick="doSave(runcode96053)" type="button" value="保存代码">[Ctrl+A 全选 注:<a href="http://www.jb51.net/article/23421.htm" title="查看具体详情" target="_blank">如需引入外部Js需刷新才能执行</a>]</div> <br><div class="htmlarea"> <textarea id="runcode87767"> <script> a=0 a?0:(alert(a),alert(1-a)) </script> </textarea><br><input onclick="runEx('runcode87767')" type="button" value="运行代码"> <input onclick="doCopy('runcode87767')" type="button" value="复制代码"> <input onclick="doSave(runcode87767)" type="button" value="保存代码">[Ctrl+A 全选 注:<a href="http://www.jb51.net/article/23421.htm" title="查看具体详情" target="_blank">如需引入外部Js需刷新才能执行</a>]</div> <br>还可以这样写 <br><div class="htmlarea"> <textarea id="runcode65741"> <script> a=0 a==0 && (alert(a),alert(1-a)) </script> </textarea><br><input onclick="runEx('runcode65741')" type="button" value="运行代码"> <input onclick="doCopy('runcode65741')" type="button" value="复制代码"> <input onclick="doSave(runcode65741)" type="button" value="保存代码">[Ctrl+A 全选 注:<a href="http://www.jb51.net/article/23421.htm" title="查看具体详情" target="_blank">如需引入外部Js需刷新才能执行</a>]</div> <br><br>