News for hackers. Stuff that matters.
Re:Ask HN: How can I make a simple interactive website with ... by WalterGR on Tuesday May 24, 2022 @06:33PM (#31498333)
If you want to learn programming and not a specific framework, of which there are a virtually unlimited number to choose from, I’d recommend implementing it using good ol’ basic HTML and JavaScript.

If you want to publish it for the world to see, you can get free web hosting all over the place. I see Neocities come up a lot on HN.

If not, you can literally just edit a single file - mysite.html or whatever you want to call it - using Notepad - on your computer and open it in a browser.

Re:Ask HN: How can I make a simple interactive website with ... by yukistar on Tuesday May 24, 2022 @07:06PM (#31498596)
I actually never though of opening a .html file from my own computer, hah! That's kind of awesome. Thank you for the ideas for web hosting.
Re:Ask HN: How can I make a simple interactive website with ... by WalterGR on Tuesday May 24, 2022 @09:00PM (#31499449)
You're quite welcome.

Start small. There's no need to prototype beforehand. There's no need to pick up a huge framework. No need to find a web host. This is all you need to get going, in an .html file on your computer:

  <!DOCTYPE html>
  <html>
      <head>
          <title>Optometry calculator</title>
          <script>
              function add() {
                  var first = parseInt(document.getElementById("first").value);
                  var second = parseInt(document.getElementById("second").value);
                  document.getElementById("result").innerText = first + second;
              }
          </script>
      </head>
      <body>
          <p>
              First number:
              <input type="text" id="first">
          </p>
          <p>
              Second number:
              <input type="text" id="second">
          </p>
          <p>
              <button onclick="add()">Add</button>
          </p>
          <p id="result">
          </p>
      </body>
  </html>
Re:Ask HN: How can I make a simple interactive website with ... by yukistar on Wednesday May 25, 2022 @01:00AM (#31500781)
Aw, this is so cute! This gives me quite a bit of motivation to start!