How to pass a form input value into a JavaScript function

后端 未结 6 1376
野的像风
野的像风 2020-12-24 08:01

I have a generic JavaScript function which takes one parameter

function foo(val) { ...} 

and I want to call the function when submit a form

6条回答
  •  太阳男子
    2020-12-24 08:28

    Well ya you can do that in this way.

        
            

    Java Script

    function showAddress(address){
    
        alert("This is address :"+address)
    
    }
    

    That is one example for the same. and that will run.

提交回复
热议问题