"> ">
Upload presentasi
Presentasi sedang didownload. Silahkan tunggu
1
JAVASCRIPT-WEB
2
LATJS01.HTML <script> alert("Hello word"); var x = 5;
var nama = "Desrizal"; document.write(nama); </script>
3
LATJS02.HTML <script> var nama="Syaiful Anwar"; var x = 4;
var y = 2; z = x + y; alert(z); alert(nama); </script>
4
LATJS03.HTML <script> for (i = 1; i <= 10; i++)
{ document.write(i); } </script>
5
LATJS04.HTML <script> var i=1; while(i<=5)
{ document.write("Nomor : "+i +"<br />"); i++; } </script>
6
LATJS05.HTML <script> function tes()
{ document.write("Hello World!"); } function kalikan(x,y) { z = x * y; // alert("Hasil kali "+x+" * "+y+" = "+z); document.write("Hasil kali "+x+" * "+y+" = "+z); } //untuk menjalankan fungsi, cukup tulis namafungsi tes(); kalikan(5,3); </script>
7
LATJS06.HTML <html> <body>
<a href=” onclick=”alert(‘hello’)”>google</a> </body> </html>
8
LATJS07.HTML <script> function inform(){
alert("Hai anda mengklik saya") } </script> <form> <input type="button" name="test" value="Click me" onclick="inform()"> </form>
9
LATJS08.HTML <html> <body> <form name="go">
<input type="radio" name="C1" onclick="document.bgColor='lightblue'"> <input type="radio" name="C1" onclick="document.bgColor='lightyellow'"> <input type="radio" name="C1" onclick="document.bgColor='lightgreen'"> </form> </body> </html>
10
LATJS09.HTML <html> <head>
<title>Body onload example</title> </head> <body onload="alert('Halaman ini telah selesai di loading')"> Welcome to my page </body> </html>
11
LATJS10.HTML <html> <body> <table>
<tr onmouseover="this.bgColor='lightblue'" onmouseout="this.bgColor='#efefef'" bgcolor="#efefef"> <td>Baris pertama</td> </tr> <tr> <td>Baris kedua</td> </body> </html>
12
LATJS11.HTML <script> var message="Selamat datang di BSI!"
var format=message.toUpperCase() var size=1 for (i=0;i<message.length;i++) { document.write(format.charAt(i).fontsize(size).bold()) if (size<7){ size++ } else { size=1 } } </script>
13
LATJS12.HTML <script type="text/javascript">
var x=window.confirm("Apakah anda baik-baik saja?") if (x) window.alert("Good!") else window.alert("Too bad") </script>
14
LATJS13.HTML <script type="text/javascript">
var y=window.prompt("Masukkan nama anda") window.alert(y) </script>
15
LATJS14.HTML <html> <head>
<title>Menampilkan pesan Warning</title> <script language="javascript"> var pesan = "Dilarang Masuk selain Petugas!"; function warning() { alert(pesan); } function password() var passwd = prompt("Masukkan Password"); if (passwd != 'petugas') alert('Gagal'); else alert('Sukses'); </script> </head> <body onload="warning();"> <p><b>TEMPAT RAHASIA</b></p> <p>Sekali lagi saya tegaskan jangan memasuki area ini selain petugas. BERBAHAYA!!!</p> <a href="javascript: password();">Masuk =></a> </body> </html>
Presentasi serupa
© 2024 SlidePlayer.info Inc.
All rights reserved.