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