JavaScript can be placed in the <body> and the <head> sections of an HTML page.
The <script> Tag
In HTML, JavaScript code must be inserted between <script> and </script> tags.

Example

<script>
document.getElementById("demo").innerHTML = "My First JavaScript";
</script>

JavaScript in <head>

In this example, a JavaScript function is placed in the <head> section of an HTML page.
The function is invoked (called) when a button is clicked:

Example

<!DOCTYPE html>
<html>
<head>
<script>
function myFunction() {
    document.getElementById("demo").innerHTML = "Paragraph changed.";
}
</script>
</head>
<body>
<h1>My Web Page</h1>
<p id="demo">A Paragraph</p>
<button type="button" onclick="myFunction()">Try it</button>
</body>
</html>

JavaScript in <body>

In this example, a JavaScript function is placed in the <body> section of an HTML page.
The function is invoked (called) when a button is clicked:

Example

<!DOCTYPE html>
<html>
<body>

<h1>My Web Page</h1>

<p id="demo">A Paragraph</p>

<button type="button" onclick="myFunction()">Try it</button>

<script>
function myFunction() {
   document.getElementById("demo").innerHTML = "Paragraph changed.";
}
</script>

</body>
</html>

JavaScript Where To

by on 7:37 AM
  JavaScript can be placed in the <body> and the <head> sections of an HTML page. The <script> Tag In HTML, JavaScript cod...

JavaScript Tutorial:

  • JavaScript is the programming language of HTML and the Web.
  • Programming makes computers do what you want them to do.
  • JavaScript is easy to learn.
  • This tutorial will teach you JavaScript from basic to advanced. 

Why Study JavaScript?

JAVASCRIPT IS ONE OF THE 3 LANGUAGES ALL WEB DEVELOPERS MUST LEARN:

  1. HTML to define the content of web pages
  2. CSS to specify the layout of web pages
  3. JavaScript to program the behavior of web pages

JavaScript Can Change HTML Content

One of many HTML methods is getElementById().
This example uses the method to "find" an HTML element (with id="demo"), and changes the element content (innerHTML) to "Hello JavaScript":

Example

document.getElementById("demo").innerHTML = "Hello JavaScript";

JavaScript Can Change HTML Styles (CSS)

Changing the style of an HTML element, is a variant of changing an HTML attribute: 

Example

document.getElementById("demo").style.fontSize = "25px";

JavaScript Tutorial

by on 6:17 AM
JavaScript Tutorial: JavaScript is the programming language of HTML and the Web. Programming makes computers do what you want them to do. Ja...

Don’t be fooled by its dark cover, Ganymede is the most colorful free presentation template at SlidesCarnival. With some surprising layouts and very big titles it has a really modern look and feel that will fit almost any topic. Your startup elevator pitch will leave a mark with this design, keep the colorful rainbow palette for the backgrounds, or choose a single color for all slides that matches your company brand.

This free presentation template features:

  • Fully editable. Easy to change colors, text and photos
  • 25 different slides
  • Colorful and modern design that works with any accent color
  • Graphs, icons, tables and maps
  • Download this presentation as a PowerPoint PPT file and edit on your computer. Also export to PDF, JPG, etc.
  • 16:9 screen layout (Can change to 4:3 with a click on Google Slides, but some graphic assets may not work well)
Click here to:
 Download

Use this free presentation template to celebrate the Chinese New Year (Spring Festival or Lunar New Year). This elegant design features a red and gold color palette, and an illustrated reference to the year of the Monkey. You can use it for sending your greetings or talk about chinese traditions.

This free presentation template features:

  • Fully editable. Easy to change colors, text and photos
  • 25 different slides
  • Festive design inspired in Chinese New Year celebrations
  • Graphs, icons, tables and maps
  • Download this presentation as a PowerPoint PPT file and edit on your computer. Also export to PDF, JPG, etc.
  • 16:9 screen layout (Can change to 4:3 with a click on Google Slides, but some graphic assets may not work well)
Click here to:
 Download

This one is a staid free presentation template, the formal design gives credibility to your message and it will get you the trust of your audience. Use it to make your content reliable if you’re going to speak about law and justice, history or ethics. Change the background gradient to a solid color if you want to make it even more formal, or adapt it to a specific corporate identity.

This free presentation template features:

  • Fully editable. Easy to change colors, text and photos
  • 25 different slides
  • Trustworthy and serious design with justice related icons
  • Graphs, icons, tables and maps
  • Download this presentation as a PowerPoint PPT file and edit on your computer. Also export to PDF, JPG, etc.
  • 16:9 screen layout (Can change to 4:3 with a click on Google Slides, but some graphic assets may not work well)
Click here to:
 Download

This free presentation template is designed for medical, health or fitness related topics. Human body (man & woman) illustrations are included in a way that can be customized, as focus and pain points can be moved depending on your needs. The design is clean and simple, very easy to use, and if you want to remove the human body illustrations it would adapt to almost any topic. As it uses a single accent color it’s easy to adapt to your brand, so you can use it in your reports or company meetings. Serious and important content needs a professional design and that is what you’ll get with this theme.

This free presentation template features:

  • Fully editable. Easy to change colors, text and photos
  • 25 different slides
  • Simple and professional design with human body illustrations
  • Graphs, icons, tables and maps
  • Download this presentation as a PowerPoint PPT file and edit on your computer. Also export to PDF, JPG, etc.
  • 16:9 screen layout (Can change to 4:3 with a click on Google Slides, but some graphic assets may not work well)
Click here to:
 Download

Cadwal is one of the most popular templates at SlidesCarnival, and it was a pity that it wasn’t optimized for presentations. So I’ve created Arvirargus, with increased text size and contrast that make it readable in screen projected slide decks. Style keeps being clean and professional, and this design will fit almost any topic. You can keep the colorful rainbow palette, or choose a single color for all slides that matches your brand. It looks great either way!
Thanks to Avery W. Krouse for the suggestion of creating this template.

This free presentation template features:

  • Fully editable. Easy to change colors, text and photos
  • 25 different slides
  • Clean and professional design that works with any accent color
  • Graphs, icons, tables and maps
  • Download this presentation as a PowerPoint PPT file and edit on your computer. Also export to PDF, JPG, etc.
  • 16:9 screen layout (Can change to 4:3 with a click on Google Slides, but some graphic assets may not work well)
Click here to:
 Download