Clear form input programmatically


#1

I want to simulate the ‘input-clear-button’ programmatically - F7 uses the function clearInput but when I call that I get an error Cant find variable: clearInput.

Code is simply this:

function ResetAnswer() {
	clearInput();
}

#2

@jmaynard, you could just use DOM7…

HTML:
<input type="text" id="sampleInput">

JS:
var $$ = Dom7;

$$('input#sampleInput').val(''); //set it to nothing any you're good to go..

#3

Max
not sure I understand why but it works perfectly - thanks!