Reputation: 2277
I know that using this jQuery
tool
$('.myDiv input').each(function () {
$(this).val("");
});
clears my form but can anyone help me with some suggestions how to keep placeholders
of the input?
Right now the placeholders appears only after I focus on at least one input.
Upvotes: 0
Views: 7551
Reputation: 57095
function Clear()
{
$('.myDiv input').each(function () {
$(this).val("");
x=1;
});
$('.myDiv input').first().focus();
}
Working Demo http://jsfiddle.net/s8vPG/2/
Upvotes: 4