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

Pengenalan AngularJS
Pengenalan AngularJSPengenalan AngularJS
Pengenalan AngularJSEdi Santoso
 
PHP SESSIONS & COOKIE.pptx
PHP SESSIONS & COOKIE.pptxPHP SESSIONS & COOKIE.pptx
PHP SESSIONS & COOKIE.pptxShitalGhotekar
 
Javascript MVVM with Vue.JS
Javascript MVVM with Vue.JSJavascript MVVM with Vue.JS
Javascript MVVM with Vue.JSEueung Mulyana
 
HTML5 New and Improved
HTML5   New and ImprovedHTML5   New and Improved
HTML5 New and ImprovedTimothy Fisher
 
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 AhmedabadNicheTech Com. Solutions Pvt. Ltd.
 
МИХАЙЛО БОДНАРЧУК «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 2019GoQA
 
Java script errors &amp; exceptions handling
Java script  errors &amp; exceptions handlingJava script  errors &amp; exceptions handling
Java script errors &amp; exceptions handlingAbhishekMondal42
 
การเข ยนโปรแกรมต ดต_อฐานข_อม_ล
การเข ยนโปรแกรมต ดต_อฐานข_อม_ลการเข ยนโปรแกรมต ดต_อฐานข_อม_ล
การเข ยนโปรแกรมต ดต_อฐานข_อม_ลBongza Naruk
 
Web Application in java.pptx
Web Application in java.pptxWeb Application in java.pptx
Web Application in java.pptxPranodPawar
 
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 WireAndreas Nedbal
 
Devoxx 2014-webComponents
Devoxx 2014-webComponentsDevoxx 2014-webComponents
Devoxx 2014-webComponentsCyril Balit
 
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 codeLaurence Svekis ✔
 
StHack 2014 - Mario "@0x6D6172696F" Heiderich - JSMVCOMFG
StHack 2014 - Mario "@0x6D6172696F" Heiderich - JSMVCOMFGStHack 2014 - Mario "@0x6D6172696F" Heiderich - JSMVCOMFG
StHack 2014 - Mario "@0x6D6172696F" Heiderich - JSMVCOMFGStHack
 
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 extensionHendy 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

Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsJoaquim Jorge
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Enterprise Knowledge
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
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.pdfsudhanshuwaghmare1
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024The Digital Insurer
 
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 2024The Digital Insurer
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProduct Anonymous
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
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 Takeoffsammart93
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdflior mazor
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
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...Martijn de Jong
 

Recently uploaded (20)

Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
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
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation 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
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
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
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
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...
 

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 "); } 