I’m using VS code as my code editor (not sure if it’s relevant). My first project is on Changing Background Color. Once I’m done writing my codes, how do I get them to show on a browser?
I’m not sure how to get it to show on a browser.
I’m using VS code as my code editor (not sure if it’s relevant). My first project is on Changing Background Color. Once I’m done writing my codes, how do I get them to show on a browser?
I’m not sure how to get it to show on a browser.
3
Answers
You want see your code in browser you will open live server of the code docoument –
open a HTML file and right-click on the editor and click on Open with Live Server .
or just type this url in browser
5500 is a default port
or just install an extensions live server it will directly open the browser.
The best way in my opnion to execute JavaScript in your browser is to put it inside a script element inside an HTML document.
I mean that in the same folder that you have the js file, create an html file and in there put the script link of the file.
This need to be in the
<head></head>
hi in vscode download live server then click html file with right click and open with browser