我想更改font-family
和input text
當用戶選擇它進入某物時。如何在選中後更改字體系列的輸入
現在,我應該使用jquery
還是css
?
默認:
<input style="font-family:xxx" type="text" placeholder="test" />
後選中進入某事:
<input style="font-family:yyy" type="text" placeholder="test" />
我想更改font-family
和input text
當用戶選擇它進入某物時。如何在選中後更改字體系列的輸入
現在,我應該使用jquery
還是css
?
默認:
<input style="font-family:xxx" type="text" placeholder="test" />
後選中進入某事:
<input style="font-family:yyy" type="text" placeholder="test" />
使用CSS:重點選擇
input:focus{
font-family: some other;
}
只是應用一些CSS的元素的焦點。
input:focus { font-family: xxxx; }
如果你想使用jQuery你可以考慮.focus(),或對.focusin()和.focusout()。
請問我可以幫你解決這個問題。
input[type="text"] {
font-family:yyy;
}
添加或刪除類取決於你想要什麼..其中類包含字體家族? – guradio
查看本演示https://jsfiddle.net/e58r3zfL/ – guradio