Skip to content

Latest commit

 

History

History
10 lines (6 loc) · 701 Bytes

README.md

File metadata and controls

10 lines (6 loc) · 701 Bytes

ESC to Clear Input Values

Invoke the ESC key on the keyboard in Javascript to clear any inputs.

alt tag

It is also highlighted in this JS how to set different values and parameters for input fields through simple targeting.

The functionality is one of those things that, after a certain amount of use, leaves users thinking, "why is this not everywhere?". Needing to add the required onkeyup="if ( event.keyCode == 27 ) this.value=''" to every input field can be tedious and clutter otherwise simple markup. Invoking the functionality with Javascript elsewhere promotes clear readability.