What is JavaScript?

JavaScript is a client scripting language for web development. Web programmers use JavaScript to increase the interactivity between the user and the web application. Developing web pages with JavaScript is not required to have a web server installed in your machine. You can write JavaScript code in <script> and </script> block then put this code in the head block  of your HTML pages and let the browser translates the code for you.

JavaScript Basic Syntax

JavaScript code can be embedded in HTML file in the HEAD block.

<HTML>
<HEAD> 
<TITLE>My JavaScript Page</TITLE>     
<SCRIPT>
 (JavaScript code)
 
</SCTIPT> 
</HEAD>
<BODY>
</BODY>
</HTML>
 

The JavaScript code is written between <Script> and </Script> section. However, you can add JavaScript code to an object (e.g hyperlink, image, or button) to response to user action.

Example:

<A HREF="http://www.worldbestlearningcenter.com/" onClick="alert('Thanks for visiting my  home page!')">IT, Business, and Management Learning Center</A>

Note: Some browsers do not understand the <Script> and </Script>. Therefore, your web pages will display JavaScript code as normal text. To void this, you need to write your code in <!-- and -->

 

<HEAD>


<SCRIPT>
<!--

(JavaScript code)

-->
</SCRIPT>
</HEAD>





Comments

dano comment

 dano

Good javascript tutorial
Thank

10-26-2012
Name:
Comment:
Enter the text:
CAPTCHA image
HTML Comment Box is loading comments...



This website intents to provide free and high quality tutorials, examples, exercises and solutions, questions and answers of programming and scripting languages:
C, C++, C#, Java, VB.NET, Python, VBA,PHP & Mysql, SQL, JSP, ASP.NET,HTML, CSS, JQuery, JavaScript and other applications such as MS Excel, MS Access, and MS Word. However, we don't guarantee all things of the web are accurate. If you find any error, please report it then we will take actions to correct it as soon as possible.