I'm trying to run a JS method with a custom text variable as a parameter. I need to be able to write some text in a form, and then send that value to the method to execute it. I'm not sure why it's not working - it seems to be receiving the value of the VALUE as "" or blank. How would I go about doing this?
<FORM NAME="myform" ACTION="" METHOD="GET">
Choose a Place: <INPUT TYPE="text" NAME="inputbox" VALUE="" id = "place"><P>
</FORM>
<button type="button" onclick="buttonGenerator()">Generate Postcard</button>
<script>
var x = document.getElementById('place').value;
function buttonGenerator(){
generate(x);
}
</script>