I am currently using this code to replace the placeholder functionality where it is not available. I have a click listener on jQuery which 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 issue is that when using the jquery placeholder, when I changed the placeholder text and then I called $('input, textarea').placeholder();
. The new placeholder doesn't change. How can I also change the placeholder when the value changed?