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.
Tutorials
- JavaScript method doScroll()
- Popup Window Example in JavaScript
- JavaScript method deleteRow()
- JavaScript Variables and Data types
- Java Script Code of Calendar and Date Picker or Popup Calendar
- JavaScript - JavaScript Tutorial
- Looping In Java Script
- What is JavaScript? - Definition
- Conditional Examples(if - else- switch case) in JavaScript
- Classes-Objects in JavaScript
- String Number Operations in JavaScript
- Conditions In Java Script
- JavaScript - JavaScript Tutorial
- JavaScript Object Oriented Feature
- Form Validation using Regular Expressions is JavaScript
- Navigation with Combo box and Java Script
- Simple Calculator Application In Java Script
- JavaScript Combo Box Validation
- JavaScript createPopup method
- JavaScript appendChild method
- JavaScript add method
- JavaScript addImport example
- JavaScript appendData method
- JavaScript applyElement method Example
- JavaScript blink method
- JavaScript bold method
- JavaScript clear method
- JavaScript clearTimeOut method
- JavaScript click method
- JavaScript cloneNode example
- JavaScript createAttribute method
- JavaScript createCaption method
- JavaScript createComment method
- JavaScript createEventObject method
- JavaScript createTFoot method
- JavaScript createTHead method
- JavaScript deleteCaption method
- JavaScript deleteTFoot method
- JavaScript deleteTHead method
- JavaScript dragDrop method


