0
Chanief Budi Setiawan, S.T. © 2012





document.write("<p>This is a paragraph</p>");

x=document.getElementById("demo")
x.innerHTML="Hello";

<button type="b...
<script type="text/javascript">
//--your code here
</script>
<script type="text/javascript">
<!--
//--your code here
-->
<...

// one line comments

/* this is a multiline comment. Its useful for
longer comments and also to block out segments
of ...






<script type="text/JavaScript">
alert( 'Third script Block ');
function doSomething(){
alert( 'Function in Third scrip...





<!-- file: P10-1-Coba.html -->
<html>
<head>
<title>P10-1: Belajar JavaScript</title>
<script type="text/javascript">
<!--...


<!-- file: P10-2-Write.html -->
<html>
<head>
<title>P10-2: Belajar JavaScript</title>
</head>
<body>
Belajar menulis Java...




<!-- file: P10-3-PopUp.html -->
<html>
<head>
<title>P10-3: PopUp Box JavaScript</title>
<script type="text/javascript">
f...
function CobaPrompt() {
var nama = prompt("Siapa nama Anda ?", "");
alert ("Selamat datang, " + nama);
}
</script>
</head>...

<!-- file: P10-4-Aritmetika.html -->
<html>
<head>
<title>P10-4: Aritmetika JavaScript</title>
</head>
<body>
<script type...







function PerkalianAngka () {
bil1 = prompt("Angkanya ialah bla bla", "");
bil2 = prompt("Angkanya ialah bla bla", "");
h...
Javascript
Javascript
Javascript
Upcoming SlideShare
Loading in...5
×

Javascript

652

Published on

Published in: Technology
0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
652
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
39
Comments
0
Likes
1
Embeds 0
No embeds

No notes for slide

Transcript of "Javascript"

  1. 1. Chanief Budi Setiawan, S.T. © 2012
  2. 2.
  3. 3.   
  4. 4.  document.write("<p>This is a paragraph</p>");  x=document.getElementById("demo") x.innerHTML="Hello";  <button type="button" onclick="myFunction()">Click Me!</button> 
  5. 5. <script type="text/javascript"> //--your code here </script> <script type="text/javascript"> <!-- //--your code here --> </script>
  6. 6.  // one line comments  /* this is a multiline comment. Its useful for longer comments and also to block out segments of code when you’re testing */  alert("Hello me");
  7. 7.    
  8. 8.   <script type="text/JavaScript"> alert( 'Third script Block '); function doSomething(){ alert( 'Function in Third script Block '); } // Call the function doSomething doSomething(); </script>
  9. 9.   
  10. 10.  
  11. 11. <!-- file: P10-1-Coba.html --> <html> <head> <title>P10-1: Belajar JavaScript</title> <script type="text/javascript"> <!-- alert("Selamat Datang di PAW Lanjut") --> </script> </head> <body> Belajar menulis JavaScript </body> </html>
  12. 12.  
  13. 13. <!-- file: P10-2-Write.html --> <html> <head> <title>P10-2: Belajar JavaScript</title> </head> <body> Belajar menulis JavaScript<br> <script type="text/javascript"> <!-- document.write("<b>JavaScript</b> dapat ditulis"); document.write(" dalam tag <u>head</u> maupun <u>body</u><br>"); --> </script> Semua <i>browser</i> modern dapat menjalankan JavaScript </body> </html>
  14. 14.    
  15. 15. <!-- file: P10-3-PopUp.html --> <html> <head> <title>P10-3: PopUp Box JavaScript</title> <script type="text/javascript"> function CobaAlert() { alert("Pengembangan Aplikasi Web Lanjut"); } function CobaConfirm() { var jawaban = confirm("Anda sudah belajar ?"); if (jawaban == 1) { // Jika memilih OK alert("Anda jawab Ya."); } else{ // Jika memilih Cancel alert("Anda jawab Tidak."); } }
  16. 16. function CobaPrompt() { var nama = prompt("Siapa nama Anda ?", ""); alert ("Selamat datang, " + nama); } </script> </head> <body> <input type="button" onclick="CobaAlert()" value="Alert" /> <input type="button" onclick="CobaConfirm()" value="Confirm" /> <input type="button" onclick="CobaPrompt()" value="Prompt" /> </body> </html>
  17. 17.
  18. 18. <!-- file: P10-4-Aritmetika.html --> <html> <head> <title>P10-4: Aritmetika JavaScript</title> </head> <body> <script type="text/javascript"> bil1 = 12; bil2 = 13; hasil = bil1 + bil2; document.write( bil1 + " ditambah " + bil2 + " sama dengan " + hasil ); </script> </body> </html>
  19. 19.      
  20. 20.  function PerkalianAngka () { bil1 = prompt("Angkanya ialah bla bla", ""); bil2 = prompt("Angkanya ialah bla bla", ""); hasil = bil1 * bil2; alert (" bla bla bla "); } 
  1. A particular slide catching your eye?

    Clipping is a handy way to collect important slides you want to go back to later.

×