adi*_*dit 8 html javascript jquery html5 opera-mini
我目前正在使用此代码替换不可用的占位符功能.我在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");
})
Run Code Online (Sandbox Code Playgroud)
问题是当使用jquery占位符时,我更改了占位符文本然后调用了$('input, textarea').placeholder();
.新的占位符不会改变.如何在值更改时更改占位符?