How to add font color in a text by using document.write | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

How to add font color in a text by using document.write

21st Sep 2022, 5:54 AM
Aswanidev Vs
2 Answers
0
document.write("<font color=\"blue\">["+time()+"]</font>"); document.write('<font color="blue">['+time()+"]</font>"); document.write("<font color='blue'>["+time()+"]</font>");
21st Sep 2022, 6:47 AM
Kamil
- 1
You need to use getElementById().style.color or with document.write("<font color='blue'>" text here " </font>");
21st Sep 2022, 6:48 AM
Jason Kennedy