How to add TextBox value in Java Script

April 06, 2015 0 Comments

<!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

Jacob Lefore

Some say he’s half man half fish, others say he’s more of a seventy/thirty split. Either way he’s a fishy bastard. Google