2
有沒有辦法給下面的對象添加不同的顏色......當我輸出到textarea時,我所做的方式不起作用。Javascript使用textarea改變字體顏色
//Print out InputTextToSave 10
document.getElementById('inputTextToSave10').innerHTML=
"Name" + "\n" + studentname.fontcolor("red").bold()
+ "Number " + studentnumber.fontcolor("blue").bold();
<textarea id="inputTextToSave10" style="width: 1300px; height: 857px;
background-color: #333333; font-family: Arial; font-size: small; font-
weight: normal; color: #FFFFFF;"></textarea>
Alexa,你不能在同一個textarea中使用不同的顏色。 – Viktor
什麼是studentname和studentnumber? 你說它不起作用。你有錯誤嗎? – Adelin
類似的帖子 - https://stackoverflow.com/questions/37139076/change-color-of-specific-words-in-textarea –