I have simple 2 text field. One is normal text and another i have used for datepicker. I want to clear placeholder onfocus
and show again onblur
this is following code i am using:
$('input,textarea').focus(function(){
$(this).data('placeholder',$(this).attr('placeholder'))
console.log($(this).data('placeholder'));
$(this).attr('placeholder','');
});
$('input,textarea').blur(function(){
console.log("adding "+$(this).data('placeholder'));
$(this).attr('placeholder',$(this).data('placeholder'));
});
For normal text its working fine but for datepicker text field placeholder not coming after blur. Is there is any solution so that datepicker text field could behave like simple text field ?
Try with DEMO