hello world js
·
1 min read
·
edit
result
code
<div id="container">
</div>
<script>
let cnt = document.getElementById("container");
cnt.style.padding = "1em";
cnt.style.margin = "1em";
cnt.style.borderRadius = "1em";
cnt.style.width = "6em";
cnt.style.border = "1px solid #f88";
cnt.innerHTML = "Hello, World!";
</script>
steps
- Open a plain text editor, e.g. vim, nano, Notepad++, VS Code.
- Copy and paste code given above.
- Save with new name, e.g.
jstu-01-hello-world.html. - View using an internet browser, e.g. Google Chrome, Mozilla Firefox, Apple Safari.
- Edit HTML file for further modification.
- Save the changes
- Refresh internet browser to see updated result.
- Repeat the previous three steps (5-7).
- Close the internet browser.
- Close the plain text editor.