I want to be able to have a user write some form of data to a html input field, and then have that data copied and saved to a javascript variable that I can evaluate later.
I'm fairly new to javascript, and right now i have an input and a button set up on a HTML page.
<input id='input' type='text' placeholder='Enter your action...'>
<button id='button'>Enter</button>
button.addEventListener('click', function() {
let userData = inputAfterButtonClick
}
I expect it to save the data the user has typed and save it to a variable.