I need to get a value from an HTML input in a JavaScript function. I can successfully get the value form the HTML pass that value to other function that is available on that JavaScript.
This is my HTML code:
<input value="3232" id="demo">
This is my script with the main function, and I can get the value from the HTML:
var PageKey = function(){
var val = document.getElementById('demo').value
return val;
}
This is what I tried. I can just call the PageKey function in fun3 to get the output, but the returned value of PageKey function should input to fun3 argument. Ex: appData argument should be holding the returned value.
var fun3 = function(appData){
}
fun3(PageKey()). Insidefun3, you can now useappDatato refer to the returned value.fun3going to look like? What's the point of putting it in a function? Why do you have anappDataparameter in the first place if you're never going to use it for anything other thanPageKey()?