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

Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersThousandEyes
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 3652toLead Limited
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Paola De la Torre
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphNeo4j
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksSoftradix Technologies
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhisoniya singh
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024Scott Keck-Warren
 
Azure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAzure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAndikSusilo4
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure servicePooja Nehwal
 
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
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...shyamraj55
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationSafe Software
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 

Recently uploaded (20)

Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other Frameworks
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping Elbows
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024
 
Azure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAzure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & Application
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
 
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
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 

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