I have a phone input on a form. Im using masked input and i had to create a span simulating a value for when user clicks the input it removes the span, but if the user doesnt fill all the mask, on blur, it doenst show the false value (span im using).
Im using span coz i had the same issue using value..
$('#telefone').on({
focus: function(){
$('#contato span.value_telefone').hide();
$('#contato #telefone').mask('(99) 9999-9999');
},
blur: function(){
if($('#contato #telefone').val()=='' || $('#contato #telefone').val()=='(__) ____-____'){
$('#contato span.value_telefone').show();
}
}
});
$('#contato span.value_telefone').click(function(){
$(this).hide();
$('#contato #telefone').mask('(99) 9999-9999');
$('#contato #telefone').focus();
});