Coding Steps:
1. you need to write your JavaScript code inside the script blocks
<script type="text/javascript"> and </script>
2. use JavaScript function document.write() to print any value on screen. pass value inside the function.
First JavaScript program Code:
<html>
<body>
<script type="text/javascript">
document.write("My First JavaScript Program.!");
</script>
</body>
</html>
Output of JavaScript program:
How to Run this program:
1. Copy the code above and paste to notepad file
2. Save file as SomeFileName.html (Please note that give file extension to .html or .htm)
3. Open this file in Internet explorer.
No comments:
Post a Comment