Home Javascript Writing Simple Java Script Program

Related Tutorials


 
 

Share on Google+Share on Google+

Writing Simple Java Script Program

Advertisement
In this article you learn the basics of JavaScript and create your first JavaScript program.

Writing Simple Java Script Program

     

In this article you learn the basics of JavaScript and create your first JavaScript program.

Creating your first JavaScript Program

In the last lesson you learned how to create simple java script program. To run the program open the html file in any browser and click on the "Run Java Script First Program". The will display the message box. Here is the screen shot of the browser.

Test JavaScript program from here.

Here is the code of JavaScript program:

<html>
<head>
<title>First Java Script</title>
<script language="JavaScript">
function sayhello(){
alert("Welcome to JavaScript World!");
}
</script>

</head>
<body>

<p><b>Click the following link to run your first java script example</b></p>
<p><a href="javascript:sayhello()">Run JavaScript First Program</a></p>

</body>

Following is the JavaScript program that will show the message:

<script language="JavaScript">
function sayhello(){
alert("Welcome to JavaScript World!");
}
</script>

The alert() function of the java script displays message.

 

     

Advertisements

If you enjoyed this post then why not add us on Google+? Add us to your Circles



Liked it!  Share this Tutorial


Follow us on Twitter, or add us on Facebook or Google Plus to keep you updated with the recent trends of Java and other open source platforms.

Posted on: June 11, 2009

Related Tutorials

Discuss: Writing Simple Java Script Program   View All Comments

Post your Comment


Your Name (*) :
Your Email :
Subject (*):
Your Comment (*):
  Reload Image
 
 
Comments:20
Hanumant Bandgar
March 2, 2012
Web Development

Its more useful for the Teaching.
divya
March 10, 2012
javascript want to any new produced

usually of simple logic contents
yones
March 13, 2012
were is porgram

program downloaded
Gerald
June 15, 2012
writting program in javascript

A sales manager wants to know the percentage increase in sales for 2011 compared with 2010. Convert percentages to the standard format(multiplying the decimal amount by 100) and display them with two decimal places. Using Javascript, write a program that implements the sales increase Percentage algorithm.
rupak
June 28, 2012
javascript

study
sumi
December 27, 2012
javascript

hi, can anybody can say that how to convert this following code into javascript.? <script> $(function () { $("#table1 tbody.rep-drag").sortable({ revert: true }); $("#table1 tbody.rep-drag").disableSelection(); }); </script> where table1 is id for class and rep-drag for class for body.
Herad Majhi
December 17, 2012
Relation of number

how to code java script programme?
shraddha dwivedi
September 20, 2012
opening steps of java script

how to open& run java script?
DIPAK NILKANTH
September 21, 2012
java script

there are two error in simple java script program
DMCA.com