Area Web / html

JS Action: Tombol Alert

loading...
ACE EDITOR
🌎 Loading... ✕
localhost:8080/index.html

✨ AI MENTOR

Klik tombol di atas untuk cek kodemu.

Target Pembelajaran 3 TUGAS

  • HTML: Beri id='tombol-api' ke button
  • CSS: Ubah warna tombol jadi merah
  • JS: Panggil alert('ROKET DILUNCURKAN!')
Petunjuk:

Sistem peluncuran roket macet! Kita perlu menghubungkan tombol merah ke sistem komputer.

  1. HTML: Berikan identitas id="tombol-api" pada elemen <button>.
  2. CSS: Ubah warna tombol agar terlihat berbahaya (Ganti gray menjadi red).
  3. JS: Lengkapi kode di dalam fungsi onclick. Ketik alert("ROKET DILUNCURKAN!");.

Setelah selesai, klik tombol â–¶ RUN PREVIEW, lalu coba klik tombol merah di layar kanan. Jika benar, notifikasi akan muncul!