Getting the value is easy with something like
You'd need to trigger that in some way, perhaps when the user leaves the field. So (assuming your input has an ID of "myElement"...
let theValue = el.value
What this is doing...
Get the element on the page with an ID of 'myElement'
Adds a listener to it for the 'blur' event (when the user leaves the element)
When that happens it executes a function and passes the element into it
Sets a variable (theValue) with the value of the element.