SlideShare a Scribd company logo
1 of 23
Download to read offline
Chanief Budi Setiawan, S.T. © 2012





document.write("<p>This is a paragraph</p>");

x=document.getElementById("demo")
x.innerHTML="Hello";

<button type="button"
onclick="myFunction()">Click Me!</button>

<script type="text/javascript">
//--your code here
</script>
<script type="text/javascript">
<!--
//--your code here
-->
</script>

// 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");






<script type="text/JavaScript">
alert( 'Third script Block ');
function doSomething(){
alert( 'Function in Third script Block ');
}
// Call the function doSomething
doSomething();
</script>





<!-- 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>


<!-- 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>




<!-- 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.");
}
}
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>

<!-- 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>







function PerkalianAngka () {
bil1 = prompt("Angkanya ialah bla bla", "");
bil2 = prompt("Angkanya ialah bla bla", "");
hasil = bil1 * bil2;
alert (" bla bla bla ");
}


More Related Content

Similar to Javascript

การเข ยนโปรแกรมต ดต_อฐานข_อม_ล
การเข ยนโปรแกรมต ดต_อฐานข_อม_ลการเข ยนโปรแกรมต ดต_อฐานข_อม_ล
การเข ยนโปรแกรมต ดต_อฐานข_อม_ล
Bongza Naruk
 
How to create a magento controller in magento extension
How to create a magento controller in magento extensionHow to create a magento controller in magento extension
How to create a magento controller in magento extension
Hendy Irawan
 

Similar to Javascript (20)

Java Script (Module 1).pptx
Java Script (Module 1).pptxJava Script (Module 1).pptx
Java Script (Module 1).pptx
 
Pengenalan AngularJS
Pengenalan AngularJSPengenalan AngularJS
Pengenalan AngularJS
 
PHP SESSIONS & COOKIE.pptx
PHP SESSIONS & COOKIE.pptxPHP SESSIONS & COOKIE.pptx
PHP SESSIONS & COOKIE.pptx
 
Javascript MVVM with Vue.JS
Javascript MVVM with Vue.JSJavascript MVVM with Vue.JS
Javascript MVVM with Vue.JS
 
jQuery
jQueryjQuery
jQuery
 
Vue.js for beginners
Vue.js for beginnersVue.js for beginners
Vue.js for beginners
 
HTML5 New and Improved
HTML5   New and ImprovedHTML5   New and Improved
HTML5 New and Improved
 
Java Script
Java ScriptJava Script
Java Script
 
Java Training Ahmedabad , how to Insert Data in Servlet, iOS Classes Ahmedabad
Java Training Ahmedabad , how to Insert Data in Servlet, iOS Classes AhmedabadJava Training Ahmedabad , how to Insert Data in Servlet, iOS Classes Ahmedabad
Java Training Ahmedabad , how to Insert Data in Servlet, iOS Classes Ahmedabad
 
Coldfusion with Keith Diehl
Coldfusion with Keith DiehlColdfusion with Keith Diehl
Coldfusion with Keith Diehl
 
МИХАЙЛО БОДНАРЧУК «SuperCharged End to End Testing with CodeceptJS» QADay 2019
МИХАЙЛО БОДНАРЧУК «SuperCharged End to End Testing with CodeceptJS»  QADay 2019МИХАЙЛО БОДНАРЧУК «SuperCharged End to End Testing with CodeceptJS»  QADay 2019
МИХАЙЛО БОДНАРЧУК «SuperCharged End to End Testing with CodeceptJS» QADay 2019
 
Java script errors &amp; exceptions handling
Java script  errors &amp; exceptions handlingJava script  errors &amp; exceptions handling
Java script errors &amp; exceptions handling
 
JavaScript Operators
JavaScript OperatorsJavaScript Operators
JavaScript Operators
 
การเข ยนโปรแกรมต ดต_อฐานข_อม_ล
การเข ยนโปรแกรมต ดต_อฐานข_อม_ลการเข ยนโปรแกรมต ดต_อฐานข_อม_ล
การเข ยนโปรแกรมต ดต_อฐานข_อม_ล
 
Web Application in java.pptx
Web Application in java.pptxWeb Application in java.pptx
Web Application in java.pptx
 
Un-Framework - Delivering Dynamic Experiences with HTML over the Wire
Un-Framework - Delivering Dynamic Experiences with HTML over the WireUn-Framework - Delivering Dynamic Experiences with HTML over the Wire
Un-Framework - Delivering Dynamic Experiences with HTML over the Wire
 
Devoxx 2014-webComponents
Devoxx 2014-webComponentsDevoxx 2014-webComponents
Devoxx 2014-webComponents
 
10 java script projects full source code
10 java script projects full source code10 java script projects full source code
10 java script projects full source code
 
StHack 2014 - Mario "@0x6D6172696F" Heiderich - JSMVCOMFG
StHack 2014 - Mario "@0x6D6172696F" Heiderich - JSMVCOMFGStHack 2014 - Mario "@0x6D6172696F" Heiderich - JSMVCOMFG
StHack 2014 - Mario "@0x6D6172696F" Heiderich - JSMVCOMFG
 
How to create a magento controller in magento extension
How to create a magento controller in magento extensionHow to create a magento controller in magento extension
How to create a magento controller in magento extension
 

Recently uploaded

Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Victor Rentea
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 

Recently uploaded (20)

Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
 
Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 

Javascript

  • 1. Chanief Budi Setiawan, S.T. © 2012
  • 2.
  • 3.
  • 5.  document.write("<p>This is a paragraph</p>");  x=document.getElementById("demo") x.innerHTML="Hello";  <button type="button" onclick="myFunction()">Click Me!</button> 
  • 6. <script type="text/javascript"> //--your code here </script> <script type="text/javascript"> <!-- //--your code here --> </script>
  • 7.  // 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");
  • 9.   <script type="text/JavaScript"> alert( 'Third script Block '); function doSomething(){ alert( 'Function in Third script Block '); } // Call the function doSomething doSomething(); </script>
  • 11.
  • 13. <!-- 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>
  • 15. <!-- 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>
  • 17. <!-- 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."); } }
  • 18. 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>
  • 19.
  • 20. <!-- 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>
  • 22.
  • 23.  function PerkalianAngka () { bil1 = prompt("Angkanya ialah bla bla", ""); bil2 = prompt("Angkanya ialah bla bla", ""); hasil = bil1 * bil2; alert (" bla bla bla "); } 