SlideShare a Scribd company logo
1 of 7
JavaScript Tutorial
• JavaScript is a language that adds functionality and interactivity to
websites. While HTML can create a web page, and CSS can customize its
appearance, the page will be static. It won’t do anything.
• How do you fix that? JavaScript! JavaScript makes many things possible on
web pages. It responds to user events like clicks, hovers or key presses. It
changes HTML, changes CSS and makes web pages interactive.
• Like CSS, there are three ways that JavaScript is embedded on web pages –
inline, internal and external.
Inline JavaScript
• When embedding inline CSS in an HTML tag, websites use the style
attribute. When embedding inline JavaScript however, there are a
number of attributes that are used.
• One of these attributes is onclick. Any JavaScript code inside an
onclick attribute gets executed when the HTML element is clicked.
• The inner text of the below <strong> tag is currently ‘Text’. JavaScript
will change the inner text to ‘Bold Text’ when the element is clicked.
• <strong> onclick="this.innerText = 'Bold Text';">Text</strong>
• Text
Internal JavaScript
• Like CSS, inline JavaScript is uncommon. Often, websites have scripts that
involve multiple HTML elements, so they tend to collect them all up and
place them together in one big script, using the HTML <script> tag.
• <script>
• var num = 142857;
• document.getElementById('bold').innerText = num;
• </script>
• The <script> tag is often placed as the last element inside a website’s
<body>. This is so that all the HTML elements can fully load before they get
transformed by the JavaScript.
External JavaScript
• Often, a website will have its JavaScript in a separate file called
script.js. This allows the site to use the same script on multiple web
pages. Here’s how a website would link to an external JavaScript file,
assuming the file name is script.js:
• <script src="script.js"></script>
• Like with internal JavaScript, this tag is often placed near the end of
the <body> element on a web page.
Want More JavaScript?
• There’s only so much this tutorial can cover. If you want to take JavaScript
further, there’s plenty of extensive JavaScript training available.
• There are some great providers of online JavaScript training like Treehouse
and Codecademy. There are also plenty of great books on JavaScript, such
as JavaScript: The Definitive Guide and JavaScript: The Good Parts.
• See all JavaScript training recommendations…
• Stick around for the next tutorial, and you’ll learn how to write more
simple scripts with PHP.

More Related Content

What's hot

Week01 jan19 introductionto_php
Week01 jan19 introductionto_phpWeek01 jan19 introductionto_php
Week01 jan19 introductionto_php
Jeanho Chu
 

What's hot (20)

WordPress & Backbone.js
WordPress & Backbone.jsWordPress & Backbone.js
WordPress & Backbone.js
 
Club website demo
Club website demoClub website demo
Club website demo
 
Javascript
JavascriptJavascript
Javascript
 
Tf ffccjs
Tf   ffccjsTf   ffccjs
Tf ffccjs
 
Tf frccjs
Tf frccjsTf frccjs
Tf frccjs
 
WordCamp Tokyo 2011 komori
WordCamp Tokyo 2011 komoriWordCamp Tokyo 2011 komori
WordCamp Tokyo 2011 komori
 
Tf ffccjs
Tf ffccjsTf ffccjs
Tf ffccjs
 
Using html5 to build offline applications
Using html5 to build offline applicationsUsing html5 to build offline applications
Using html5 to build offline applications
 
Super quick introduction to html5
Super quick introduction to html5Super quick introduction to html5
Super quick introduction to html5
 
Ajax
AjaxAjax
Ajax
 
Multi-content Containers in dotCMS 3.0
Multi-content Containers in dotCMS 3.0Multi-content Containers in dotCMS 3.0
Multi-content Containers in dotCMS 3.0
 
How to Boost the performance of your Wordpress powered websites
How to Boost the performance of your Wordpress powered websitesHow to Boost the performance of your Wordpress powered websites
How to Boost the performance of your Wordpress powered websites
 
Html5
Html5Html5
Html5
 
Modern web application devlopment workflow
Modern web application devlopment workflowModern web application devlopment workflow
Modern web application devlopment workflow
 
Forms as Structured Content
Forms as Structured Content Forms as Structured Content
Forms as Structured Content
 
Gatsby intro
Gatsby introGatsby intro
Gatsby intro
 
LESS is More (ChiHTML5 Meetup June 2016)
LESS is More (ChiHTML5 Meetup June 2016)LESS is More (ChiHTML5 Meetup June 2016)
LESS is More (ChiHTML5 Meetup June 2016)
 
Modern Static Site with GatsbyJS
Modern Static Site with GatsbyJSModern Static Site with GatsbyJS
Modern Static Site with GatsbyJS
 
Dreamweaver
DreamweaverDreamweaver
Dreamweaver
 
Week01 jan19 introductionto_php
Week01 jan19 introductionto_phpWeek01 jan19 introductionto_php
Week01 jan19 introductionto_php
 

Similar to Java script tutorial

Instagram filters (8 24)
Instagram filters (8 24)Instagram filters (8 24)
Instagram filters (8 24)
Ivy Rueb
 
Java script202
Java script202Java script202
Java script202
Wasiq Zia
 
Html css crash course may 11th, atlanta
Html css crash course may 11th, atlantaHtml css crash course may 11th, atlanta
Html css crash course may 11th, atlanta
Thinkful
 
&lt;img src="../i/r_14.png" />
&lt;img src="../i/r_14.png" />&lt;img src="../i/r_14.png" />
&lt;img src="../i/r_14.png" />
tutorialsruby
 
Essential_Javascript_--_A_Javascript_Tutorial
Essential_Javascript_--_A_Javascript_TutorialEssential_Javascript_--_A_Javascript_Tutorial
Essential_Javascript_--_A_Javascript_Tutorial
tutorialsruby
 
Essential Javascript -- A Javascript &lt;b>Tutorial&lt;/b>
Essential Javascript -- A Javascript &lt;b>Tutorial&lt;/b>Essential Javascript -- A Javascript &lt;b>Tutorial&lt;/b>
Essential Javascript -- A Javascript &lt;b>Tutorial&lt;/b>
tutorialsruby
 
Essential_Javascript_--_A_Javascript_Tutorial
Essential_Javascript_--_A_Javascript_TutorialEssential_Javascript_--_A_Javascript_Tutorial
Essential_Javascript_--_A_Javascript_Tutorial
tutorialsruby
 

Similar to Java script tutorial (20)

JavaScript - Getting Started.pptx
JavaScript - Getting Started.pptxJavaScript - Getting Started.pptx
JavaScript - Getting Started.pptx
 
Instagram filters (8 24)
Instagram filters (8 24)Instagram filters (8 24)
Instagram filters (8 24)
 
JS BASICS JAVA SCRIPT SCRIPTING
JS BASICS JAVA SCRIPT SCRIPTINGJS BASICS JAVA SCRIPT SCRIPTING
JS BASICS JAVA SCRIPT SCRIPTING
 
Instagram filters (8 24)
Instagram filters (8 24)Instagram filters (8 24)
Instagram filters (8 24)
 
Javascript
JavascriptJavascript
Javascript
 
Web development basics
Web development basicsWeb development basics
Web development basics
 
Java script202
Java script202Java script202
Java script202
 
Java script
Java scriptJava script
Java script
 
Js placement
Js placementJs placement
Js placement
 
Html css crash course may 11th, atlanta
Html css crash course may 11th, atlantaHtml css crash course may 11th, atlanta
Html css crash course may 11th, atlanta
 
&lt;img src="../i/r_14.png" />
&lt;img src="../i/r_14.png" />&lt;img src="../i/r_14.png" />
&lt;img src="../i/r_14.png" />
 
Essential_Javascript_--_A_Javascript_Tutorial
Essential_Javascript_--_A_Javascript_TutorialEssential_Javascript_--_A_Javascript_Tutorial
Essential_Javascript_--_A_Javascript_Tutorial
 
Essential Javascript -- A Javascript &lt;b>Tutorial&lt;/b>
Essential Javascript -- A Javascript &lt;b>Tutorial&lt;/b>Essential Javascript -- A Javascript &lt;b>Tutorial&lt;/b>
Essential Javascript -- A Javascript &lt;b>Tutorial&lt;/b>
 
Essential_Javascript_--_A_Javascript_Tutorial
Essential_Javascript_--_A_Javascript_TutorialEssential_Javascript_--_A_Javascript_Tutorial
Essential_Javascript_--_A_Javascript_Tutorial
 
Java script by Act Academy
Java script by Act AcademyJava script by Act Academy
Java script by Act Academy
 
Web development intership Presentation.pptx
Web development intership Presentation.pptxWeb development intership Presentation.pptx
Web development intership Presentation.pptx
 
Java script
Java scriptJava script
Java script
 
Java script
Java scriptJava script
Java script
 
Bootcamp - Web Development Session 2
Bootcamp - Web Development Session 2Bootcamp - Web Development Session 2
Bootcamp - Web Development Session 2
 
Overview of PHP and MYSQL
Overview of PHP and MYSQLOverview of PHP and MYSQL
Overview of PHP and MYSQL
 

More from Son Nguyen

More from Son Nguyen (20)

Your new maven friend – the mule maven
Your new maven friend – the mule mavenYour new maven friend – the mule maven
Your new maven friend – the mule maven
 
Soa governance for the modern business
Soa governance for the modern businessSoa governance for the modern business
Soa governance for the modern business
 
Quality sdk for your apis in minutes!
Quality sdk for your apis in minutes!Quality sdk for your apis in minutes!
Quality sdk for your apis in minutes!
 
Maven tools & archetypes
Maven tools & archetypesMaven tools & archetypes
Maven tools & archetypes
 
Let api change your relationship with your doctor
Let api change your relationship with your doctorLet api change your relationship with your doctor
Let api change your relationship with your doctor
 
Increase revenue and reinvigorate your business with api
Increase revenue and reinvigorate your business with apiIncrease revenue and reinvigorate your business with api
Increase revenue and reinvigorate your business with api
 
How to – wrap soap web service around a database
How to – wrap soap web service around a databaseHow to – wrap soap web service around a database
How to – wrap soap web service around a database
 
How to – rest api proxy to soap webservice
How to – rest api proxy to soap webserviceHow to – rest api proxy to soap webservice
How to – rest api proxy to soap webservice
 
Anypoint runtime manager v1
Anypoint runtime manager v1Anypoint runtime manager v1
Anypoint runtime manager v1
 
A good api strategy can help turn your
A good api strategy can help turn yourA good api strategy can help turn your
A good api strategy can help turn your
 
10 steps to design and build the perfect
10 steps to design and build the perfect10 steps to design and build the perfect
10 steps to design and build the perfect
 
What is the difference between using private flow
What is the difference between using private flowWhat is the difference between using private flow
What is the difference between using private flow
 
Troubleshooting mule
Troubleshooting muleTroubleshooting mule
Troubleshooting mule
 
Running mule as worker role on azure
Running mule as worker role on azureRunning mule as worker role on azure
Running mule as worker role on azure
 
Real time data processing with anypoint connector for kafka
Real time data processing with anypoint connector for kafkaReal time data processing with anypoint connector for kafka
Real time data processing with anypoint connector for kafka
 
Performance tuning in mule
Performance tuning in mulePerformance tuning in mule
Performance tuning in mule
 
Mule intelli j tips
Mule intelli j tipsMule intelli j tips
Mule intelli j tips
 
Introducing the anypoint connector for redis
Introducing the anypoint connector for redisIntroducing the anypoint connector for redis
Introducing the anypoint connector for redis
 
How to – data integrity checks in batch processing
How to – data integrity checks in batch processingHow to – data integrity checks in batch processing
How to – data integrity checks in batch processing
 
How soa paved the way for cloud
How soa paved the way for cloudHow soa paved the way for cloud
How soa paved the way for cloud
 

Recently uploaded

Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
Joaquim Jorge
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
Earley Information Science
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
Enterprise Knowledge
 

Recently uploaded (20)

Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
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...
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdf
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
Evaluating the top large language models.pdf
Evaluating the top large language models.pdfEvaluating the top large language models.pdf
Evaluating the top large language models.pdf
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
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...
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
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
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
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...
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
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
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 

Java script tutorial

  • 2. • JavaScript is a language that adds functionality and interactivity to websites. While HTML can create a web page, and CSS can customize its appearance, the page will be static. It won’t do anything. • How do you fix that? JavaScript! JavaScript makes many things possible on web pages. It responds to user events like clicks, hovers or key presses. It changes HTML, changes CSS and makes web pages interactive. • Like CSS, there are three ways that JavaScript is embedded on web pages – inline, internal and external.
  • 3. Inline JavaScript • When embedding inline CSS in an HTML tag, websites use the style attribute. When embedding inline JavaScript however, there are a number of attributes that are used. • One of these attributes is onclick. Any JavaScript code inside an onclick attribute gets executed when the HTML element is clicked. • The inner text of the below <strong> tag is currently ‘Text’. JavaScript will change the inner text to ‘Bold Text’ when the element is clicked.
  • 4. • <strong> onclick="this.innerText = 'Bold Text';">Text</strong> • Text
  • 5. Internal JavaScript • Like CSS, inline JavaScript is uncommon. Often, websites have scripts that involve multiple HTML elements, so they tend to collect them all up and place them together in one big script, using the HTML <script> tag. • <script> • var num = 142857; • document.getElementById('bold').innerText = num; • </script> • The <script> tag is often placed as the last element inside a website’s <body>. This is so that all the HTML elements can fully load before they get transformed by the JavaScript.
  • 6. External JavaScript • Often, a website will have its JavaScript in a separate file called script.js. This allows the site to use the same script on multiple web pages. Here’s how a website would link to an external JavaScript file, assuming the file name is script.js: • <script src="script.js"></script> • Like with internal JavaScript, this tag is often placed near the end of the <body> element on a web page.
  • 7. Want More JavaScript? • There’s only so much this tutorial can cover. If you want to take JavaScript further, there’s plenty of extensive JavaScript training available. • There are some great providers of online JavaScript training like Treehouse and Codecademy. There are also plenty of great books on JavaScript, such as JavaScript: The Definitive Guide and JavaScript: The Good Parts. • See all JavaScript training recommendations… • Stick around for the next tutorial, and you’ll learn how to write more simple scripts with PHP.