ps : escuse me for my bad english because im french
To do this, I used SublimeText.
But you could also download Atom or similar.
I created two files.
The first is a simple HTML file, called hello.html
The HTML file looks like this:
<!DOCTYPE html> <html> <head> <title></title> </head> <body> <h1 id="hi"></h1> <script src="helloworld.js"></script> </body> </html>
What I did is put a simple
The second thing is inserting a
<script> tag, to link to my JS file.
let hello = 'Hello'; let world = 'World'; document.getElementById('hi').innerHTML = hello + world;
You can then open your HTML file with your favorite web browser.
The result is this:
Ah a fellow sublime user, a user of fine taste
I’ll just add to the console comment and say that if you make your own practice website file with html and css, if you inspect element while the file is open in the browser you can interactively type js into the console and see what effect it has on the website in real-time. It can be sometimes useful to visualize what’s happening.
thank you very much