JavaScript Tutorial


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";

No comments:

Post a Comment