Javascript fonction break

posted in: javascript | 0

Cliquez pour commencer la démonstration.

Le code expliqué

<p>Cliquez pour commencer la démonstration.</p>
<button onclick= »myFunction() »>OK</button>
<p id= »demo »></p>
<script>
function myFunction() {
var text = «  »;
var i;
for (i = 0; i < 10; i++) { if (i == 3) {break;} text += "Numéro " + i + "
« ;
}
document.getElementById(« demo »).innerHTML = text;
}
</script>

logowebmaster1