Introduction to JavaScript

   »    Free Introductory JavaScript Tutorial, Learn to Start JavaScript Coding

Computer Education, Training & Tutorial Resources - ComputerEducationWorld.com
Home » Free Web Designing Courses » Introduction to JavaScript »

An operator is a symbol which helps the user to command the computer to do a certain mathematical or logical manipulations. Operators are used in the program to operate on data and variables.

 JavaScript Operators

Arithmetic Operators
Arithmetic operators work on one or more numeric values yielding a single result.

+   Addition
-   Subtraction
*   Multiplication
/   Division
%   Modulus
++   Increment by 1
–   Decrement by 1 (more…)


• • •
 

Variables

Variables are memory locations that are given names and can be assigned values. We use variables to store data in memory for later use.

Variable names
Once a value is stored in a variable it can be accessed using the variable name. A variable name can consist of alphanumeric characters and the underscore. It cannot begin with a numeral, though. Note that variable names are case sensitive and first_name is not the same as FIRST_name.

Valid variable names
      first_name
      name2
      _car
      Average (more…)


• • •
 

The example demonstrates how to use JavaSript to write text on a web page.

<html>       

<body>       

<script type=”text/javascript”> 
document.write(”<h1>Hello World!</h1>”);       

</script>       

</body>       

</html>

Output:

Hello World!

(more…)


• • •
 

JavaScript works with HTML to bring interactivity to otherwise static documents and can be embedded inside HTML documents in three ways:

  • The code is placed between <SCRIPT> - </SCRIPT> tags.
  • Code is included inside an HTML tag.
  • The entire code is placed in another file, which is called through the SRC attribute of the <SCRIPT> tag.

Using the <SCRIPT> tags
JavaScript code is most commonly included between <SCRIPT> - </SCRIPT> tags. For example:
<HTML>
<HEAD>
<TITLE>Page title</TITLE>
</HEAD> <BODY>
<SCRIPT LANGUAGE=”JAVASCRIPT” TYPE=”TEXT/JAVASCRIPT”>
<!–

some javascript code

//–>
</SCRIPT>
</BODY>
</HTML> (more…)


• • •
 



captcha PHP Script Free PHP captcha script free php
Website Design by WebWalas.com