Javascript course for exercises (basic input)

Do you want to quickly learn how to make dynamic pages in Javascript?

Do you want to quickly learn how to make dynamic pages in Javascript? Lessons on input in Javascript: Enter the height of the starting point of a trekking and its arrival (in meters) With these data, by pressing a button, write the data on the page and calculate the total difference in level with a function. Resolution of the exercise: Let's see with other exercises in the in-person course what other possibilities we have!
<!DOCTYPE html> <html> <body> <h1>Calcolo dislivello trekking </h1> <form id="frm1" > Altezza di partenza: <input type="text" name="Hbase" value="0"><br> Altezza di arrivo: <input type="text" name="HArrivo" value="1000"><br><br> <!-- <input type="submit" value="Input dati Trekking">--> </form> <p>Calcola il dislivello:</p> <button onclick="myFunction()">Calcola il dislivello:</button> <p>Il punto di partenza รจ:</p> <p id="base"></p> <p>Il punto di arrivo รจ:</p> <p id="arrivo"></p> Il dislivello รจ di: <p id="demo"></p> <script> function myFunction() { var x = document.getElementById("frm1"); var base=x.elements[0].value; document.getElementById("base").innerHTML =base; var arrivo=x.elements[1].value; document.getElementById("arrivo").innerHTML =arrivo; document.getElementById("demo").innerHTML =Dislivello(base,arrivo); } function Dislivello(h1,h2){ return h2-h1; } </script> </body> </html>