Invoke the ESC key on the keyboard in Javascript to clear any inputs.
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.