Program JavaScript

Rajeev Tiwari Addition of two numbers using JavaScript The JavaScript code will be called on button submit event, when we will click on the button (which is placed on the HTML file). value1 = < input type = "text" id = "value1" name = "value1" value = "" /> value2 = < input type = "text" id = "value2" name = "value2" value = "" /> < script language = " javascript " > function addNumbers ( ) { var val1 = parseInt ( document . getElementById ( " value1 " ) . value ) ; var val2 = parseInt ( document . getElementById ( " value2 " ) . value ) ; var ansD = document . getElementById ( " answer " ) ; ansD . value = val1 + val2 ; } < / script > Note: JavaScript code is written within in the <script> ... </script> tag. Here , we are defining a function addNumb...