- Install VSCode text editor.
- Install live server extension on VSCode
Shortcuts in VSCode for JavaScript Template
- Press ! and press tab for HTML5 template
Write the below code in a index.html file
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta http-equiv="X-UA-Compatible" content="ie=edge"> <title>JavaScript</title> </head> <body> <script> // This is hello world /* This is multiline comment */ console.log("Hello World"); </script> </body> </html>
Rightclick on the VSCode text editor and click on Open with Live serve to open the code in the browser