How can i get the \"real\" value of an field?
I have an input
box, and i\'m using newer HTML5
Track all pressed keys based on their key codes
I suppose one could listen to the keyup events and keep an array of all characters entered, based on their keycodes. But it's a pretty tedious task and probably prone to bugs.
http://unixpapa.com/js/key.html
Select the input and get the selection as a string
document.querySelector('input').addEventListener('input', onInput);
function onInput(){
this.select();
console.log( window.getSelection().toString() )
}
All credit to: int32_t