Wednesday, 9 April 2014

JavaScript

Presentation

  • Javascript is the most prominent customizing dialect on the planet. 
  • Javascript is the dialect for the web, for HTML, for servers, Pcs, laptops, tablets, phones, and that's only the tip of the iceberg.

JavaScript is a Scripting Language

A scripting dialect is a lightweight customizing dialect. 

Javascript code could be embedded into any HTML page, and it might be executed by numerous sorts of web programs. 

Javascript is not difficult to take in. 


Change the Content of HTML Elements

The HTML DOM (Document Object Model) is the official W3C standard for accessing HTML elements.
It is very common to use JavaScript to manipulate the DOM (to change the content of HTML elements).

Example

x = document.getElementById("demo");  //Find the HTML element with id="demo"
x.innerHTML = "Hello JavaScript";     //Change the content of the HTML element


document.getElementById() is one of the most commonly used HTML DOM methods.
You can also use JavaScript to:
  • Delete HTML elements
  • Create new HTML elements
  • Copy HTML elements
  • And more ...
You will find several chapters, about the HTML DOM, in later chapters of this tutorial.

Change the Value of HTML Attributes

This example changes the source attribute (src) of an HTML <image> element:

The Light bulb
























Click the light bulb to turn on/off the light

With JavaScript, you can change almost any HTML attribute.

Change HTML Styles (CSS)

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

Example

x = document.getElementById("demo");  //Find the HTML element with id="demo" 
x.style.fontSize = "25px";            //Change the font size
x.style.color = "#ff0000";            //Change the color


"News Powered By" 



Share:

No comments:

Post a Comment

© World Of Programmers All rights reserved | Theme Designed by Seo Blogger Templates