Well, just do exactly that.
This is how you attach a
click
handler:
.click() | jQuery API Documentation[
^].
And this is how you clean up text values:
.val() | jQuery API Documentation[
^].
Assign empty string to the value, that's it. If you understand "clearing" differently, assign something else. :-)
Now, as to the drop-down lists, there is no such concept as "clearing". You can, for example, move selection to your predefined values, which may or may not be at the index 0. Such element it the element
select
. See, for example,
How to set a dropdown box value in jQuery[
^].
—SA