Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
在我的网页上,我有一个隐藏字段(input type="hidden")中的文本。当我显示文本时,我希望它是粗体的,以便突出。这可以用 CSS 或任何其他方式完成吗?我已经尝试过style="font-weight: bold;"了,但它在 Chrome 中不起作用。
input type="hidden"
style="font-weight: bold;"
<input type="text" id="myInput" value="Hello" />
CSS:
#myInput { display:none; font-weight:normal; }
Javascript:
function ShowInput() { document.getElementById("myInput").style.display="block"; document.getElementById("myInput").style.fontWeight="bold"; }
检查它http://jsfiddle.net/LvaFS/