Search

Monday, April 6, 2015
0 comments

How to add TextBox value in Java Script

6:05 AMMonday, April 6, 2015
<!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
Protected by Copyscape Online Copyright Protection Software

0 comments :

Post a Comment

 
Toggle Footer
Top