我目前正在使用 this code替换不可用的占位符功能。我在 jQuery 上有一个点击监听器,它改变了占位符文本:
$('.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");
})
问题是,在使用 jquery 占位符时,当我更改占位符文本然后调用 $('input, textarea').placeholder();
时。新的占位符不会改变。如何在值更改时更改占位符?
最佳答案
关于javascript - 在 Opera Mini 中更改占位符,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22401983/