How to add TextBox value in Java Script

<!DOCTYPE html>

    <title>encode and decode</title>
    <script type="text/javascript" >

        function validation() {

            var firstvalue = document.getElementById('first');
            var secondvalue = document.getElementById('second');
            var finalvalue = eval((firstvalue.value)+ "+" +( secondvalue.value));

<h1>Addition of two or more number</h1>

Enter Number<input type="text" name="gt" value="" id="first" /><br />
Enter Second<input type="text" name="gt" value="" id="second" />
<button onclick="validation();">Add number</button>


Code generate the following output

How to add TextBox value in Java Script


Popular posts from this blog

difference between structure and union in C Language

Difference between Linear search and Binary Search in c language

Difference between static and dynamic websites