javascript - Clear form inputs and keep placeholder -
i know using jquery
tool
$('.mydiv input').each(function () { $(this).val(""); });
clears form can me suggestions how keep placeholders
of input?
right placeholders appears after focus on @ least 1 input.
jquery
function clear() { $('.mydiv input').each(function () { $(this).val(""); x=1; }); $('.mydiv input').first().focus(); }
working demo http://jsfiddle.net/s8vpg/2/
Comments
Post a Comment