input - jquery onclick setting variable -


i set variable 'api_key' on document load. want modify variable text of input field after clicking button

var api_key = "";  //my button has id named "btn-verify", input field has id named "verify" $("#btn-verify").click({         api_key = $("#verify").val();      }); 

this doesn't work, how should fix this. how assign api_key value of input field, on click of button

you missing function declaration when binding handler.

change

$("#btn-verify").click({ 

to

//missing function declaration--v      $("#btn-verify").click(function (){ 

Comments

Popular posts from this blog

linux - Does gcc have any options to add version info in ELF binary file? -

android - send complex objects as post php java -

charts - What graph/dashboard product is facebook using in Dashboard: PUE & WUE -