Jump to content

linux1880

Members
  • Posts

    136
  • Joined

  • Last visited

Posts posted by linux1880

  1. Hi guys i would like this form to be able to user input values in the input and javascript add function will add value and display in HTML, how would i achieve it ? Thanks

     

    <script type="text/javascript">
    
    function add(x,y){
    z = (x+y);
    return z;
    }
    //alert(add(10,20));
    //alert('abc');
    
    </script>
    
    
    first number: <input type="text" value"" />
    second number: <input type="text" value"" />
    <input type="button" value="add number" onClick="alert(add(120,23))" />
    
    

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.