0
我得到这个jQuery脚本,它把占位符“+”在我的搜索输入,并且probblem的是,现在每输入了我的网站“+”占位符,jQuery的添加类输入
如何只添加格外类这个JS代码:
$(document).ready(function() {
$('input').on('focus',function(){
$(this).attr('placeholder',"");
});
$('input').on('blur',function(){
$(this).attr('placeholder',"+");
});
});
只需在'$(this)'中用类调用'addClass'? [jQuery addClass](https://api.jquery.com/addclass/) –
将类名置于选择器中......'$(“input.className”)' – Archer
由于'Archer'表示可以选择类似这个'$(“input.myClass [type = text]”)' – Ramkee