Javascript Tutorial Tutorialspoint.com
Javascript is a scripting language produced by Netscape for use within HTML Web pages. JavaScript is loosely based on Java and it is built into all the major modern browsers. This tutorial gives an initial push to start you with Javascript. For more detail kindly check tutorialspoint.com/javascript
What is JavaScript ?
JavaScript is:
JavaScript is a lightweight, interpreted programming language Designed for creating network-centric applications Complementary to and integrated with Java Complementary to and integrated with HTML Open and cross-platform
JavaScript Syntax:
A JavaScript consists of JavaScript statements that are placed within the ... HTML tags in a web page. You can place the tag containing your JavaScript anywhere within you web page but it is preferred way to keep it within the tags. The tag alert the browser program to begin interpreting all the text between these tags as a script. So simple syntax of your JavaScript will be as follows
JavaScript code
The script tag takes two important attributes:
language: This attribute specifies what scripting language you are using. Typically, its value will be javascript. Although recent versions of HTML (and XHTML, its successor) have phased out the use of this attribute. type: This attribute is what is now recommended to indicate the scripting language in use and its value should be set to "text/javascript".
So your JavaScript segment will look like:
JavaScript code
Your First JavaScript Script:
Let us write our class example to print out "Hello World".
1|Page
Tutorials Point, Simply Easy Learning Above code will display following result:
Hello World!
Whitespace and Line Breaks:
JavaScript ignores spaces, tabs, and newlines that appear in JavaScript programs. Because you can use spaces, tabs, and newlines freely in your program so you are free to format