Sunday 11 August 2013

Procedure to write java script

·         To write the java script code in the html documents we take the help of <script>
·         To specify the type of scripting language to be used in the html document we use type attribute of <script>
<script type=”text/javascript”>

Example: welcome.html

<html>
 <head>
  <title> javascript</title>
 </head>
 <body>
   <script type="text/javascript">
     document.write("welcome to java script");
   </script>
 </body>
</html>

steps:
1) save it as 'welcome.html'
2) double click that browser
see the output
output:



document.write(): is a java script command used (meant) for displaying or message on the Browser.

The Interpreter will understand to display a message written in document.write() command present in <script>

No comments:

Post a Comment