Belajar JavaScript --> PENJUMLAHAN 2 BILANGAN
Percobaan 3 (penjumlahan) <html> <head> <title> Program Aritmatika </title> <script> function getjumlah () { //deklarasi variable var hasil; var input1; var input2; //input input1 = parseInt(document . getElementById("txtinput1"). value); input2 = parseInt(document . getElementById("txtinput2"). value); //proses hasil = input1 + input2; //output document.getElementById("txthasil") .value = hasil; } </script> </head> <body> <div> <div> <label> input 1 </label> <input type="text" id="txtinput1"/> </div> <div> <label> input 2 </label> <input type="text" id="txtinput2"/> </div> <div> <label> Hasil </label> <input type="text