-->

Monday, April 6, 2015

How to add TextBox value in Java Script

How to add TextBox value in Java Script

<!DOCTYPE html>

<html>
<head>
    <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));
            alert(finalvalue);

        }
        
    </script>
</head>
<body>
<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>

</body>
</html>

Code generate the following output

How to add TextBox value in Java Script

Read other related articles

Also read other articles

© Copyright 2013 Computer Programming | All Right Reserved