Javascript : Operator Pembanding dan Logika
Operator Pembanding dan Logika
7. Script :
<HTML>
<HEAD>
<TITLE>Operator ?</TITLE>
</HEAD>
<BODY>
<SCRIPT LANGUAGE = "JavaScript">
var nilai = prompt("Nilai (0-100): ", 0);
var hasil = (nilai >= 60) ? "Lulus" : "Tidak Lulus";
document.write("Hasil: " + hasil);</SCRIPT>
</BODY>
</HTML>
Hasil :
0 komentar :
Posting Komentar