I have a button on my page which executes a JavaScript function on click. Now I have a variable in my function whose value should be the one which user enters in input text box. Here is my code.
<input type="text"> </input>
<button id ="buttton" class="button" onclick="myfunction()">Create Envelope</button>
<script>
function myfunction() {
var sub =""; // I am thinking of writing jquery
}
</script>
Now by the time user clicks the button my variable sub should hold the value which user enters in the input field.