Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!doctype>
- <html>
- <head>
- <title>Esercizio 11</title>
- <meta charset="UTF-8">
- <script>
- function somma()
- {
- var addendo1 = document.getElementById("addendo1").value;
- var addendo2 = document.getElementById("addendo2").value;
- var somma = parseFloat(addendo1) + parseFloat(addendo2);
- alert("La somma รจ: "+somma);
- }
- </script>
- </head>
- <body>
- <form>
- <p>
- <label>Addendo 1</label>
- <input type="text" id="addendo1" name="Addendo 1" value="" placeholder=" Inserisci il primo numero">
- </p>
- <p>
- <label>Addendo 2</label>
- <input type="text" id="addendo2" name="Addendo 2" value="" placeholder=" Inserisci il secondo numero">
- </p>
- <button type="button" onclick="somma()">Calcola la somma </button>
- </form>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement