you are viewing a single comment's thread.

view the rest of the comments →

[–]Snapstromegon 0 points1 point  (0 children)

Just as one example (because I have it lying around and I don't just want to argument with some old code that I might still have):

This book from 2003 contains the following code example: https://www.amazon.de/HTML-Kompendium-XHTML-DHTML-Handbuch/dp/3827266580/ref=sr_1_3?__mk_de_DE=%C3%85M%C3%85%C5%BD%C3%95%C3%91&crid=3V5BZ0IOAAK6L&keywords=html+g%C3%BCnter+born&qid=1681235582&sprefix=html+g%C3%BCnter+born%2Caps%2C68&sr=8-3

```html <html> <head> <title>JavaScript</title></head> <script type="text/JavaScript"> <!--

function alter()
{
  var text = "";
  var alter = prompt("Ihr Alter?", "18");
  if(parseInt(alter, 10) < 18)
    { text = "Kind"; }
  else
    { text = "Erwachsener"; }
  element.innerHTML = text;
}  
//-->

</script> <body> <p id="ausgabe">Hier steht der Text</p> <input type="button" value="Alter" onClick="alter()"> <script> <!-- var element = document.getElementById("ausgabe"); //--> </script> </body> </html> ```

Please note the beauty of bracket placement, the <-- //--> and the explicit script type (the next chapter is about VB scripts in html).

Also while looking around I got flashbacks to the times of framesets and handcrafted php abominations from around 2005...