butiran

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

  1. Open a plain text editor, e.g. vim, nano, Notepad++, VS Code.
  2. Copy and paste code given above.
  3. Save with new name, e.g. jstu-01-hello-world.html.
  4. View using an internet browser, e.g. Google Chrome, Mozilla Firefox, Apple Safari.
  5. Edit HTML file for further modification.
  6. Save the changes
  7. Refresh internet browser to see updated result.
  8. Repeat the previous three steps (5-7).
  9. Close the internet browser.
  10. Close the plain text editor.