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

Popular posts from this blog

java - Jmockit String final length method mocking Issue -

asp.net - Razor Page Hosted on IIS 6 Fails Every Morning -

c++ - wxwidget compiling on windows command prompt -