Run Javascript in Web Page
Development Tools
Javascript can be written in Any Text Editor like Notepad or Wordpad.
But, to make our life simpler various vendors have come up with very nice JavaScript editing tools. Some of them are listed here −
Sublime Text Editor
Atom
Visual Studio Code (VS CODE)
Adobe Muse
Eclipse
Brackets
Adobe Dreamweaver
How to write Code.
- Create a HTML File. (You have learnt this in previous chapter)
- Type the Following Code in file by using Text Editor.
- Save that file.
- Open That File in Any Web Browser and open console Tab, you will see the Output "Hello World"
Explanation
All The Things You Write in HTML Code should be written inside opening<html> and Closing </html> Tag.
Inside html tag There are 2 Tags :
- <head>
- <body>
All The Heading Part of the Project i.e. Title , Meta Description is placed inside the opening <head> and closing </head> tag.
All The Body part of the Project i.e. Image , Bullets , Div is placed inside the opening <body> and closing </body> tag.
All Javascript Coding is placed inside the opening <script> and closing </script> tag.
You can place <script> tags anywhere inside <body> or <head>.
Any Number of Javascript code can be written in HTML file by using <script> Tag.