I am currently using this code to replace placeholder functionality where it is not available. I have a jQuery click listener that changes the placeholder text:
$('.contact-type').change(function(event) { $contactInfo = $(this).closest('div').prev().find('#contact-info'); $contactInfo.removeClass(); $contactInfo.addClass('form-control input-lg'); $contactInfo.addClass('validate[required,custom[line]]'); $contactInfo.attr("placeholder", "LINE ID"); })
The problem is that when using jquery placeholder, when I changed the placeholder text and then I called $('input, textarea').placeholder(); . The new placeholder does not change. How can I change the placeholder when changing the value?
javascript jquery html html5 opera-mini
adit
source share