附:运行举例
2016-05-23 本文已影响8人
MC_DEV_JIN
breakevent.html
breakevent.htmlfunction myFunction() {
var text = ""
var i;
for (i = 0; i < 5; i++) {
if (i == 3) {// 此处用== 与 === 的区别
break;
}
text += "The number is " + i + "";
}
document.getElementById("demo").innerHTML = text;}