Cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How to change text fill with javascript.

ANSWERED

I tried.

 

In index.js

let myLabel = document.getElementById("myTime");
myLabel.style.fill = "Black";

 

In style.css

#myTime {
font-size: 40;
font-family: System-Bold;
text-length: 5;
text-anchor: middle;
x: 20%;
y: 20%;
fill: white;
}

 

but text disappeared.

Please help me.

Best Answer
0 Votes
1 BEST ANSWER

Accepted Solutions

Try all lower case.

Peter McLennan
Gondwana Software

View best answer in original post

Best Answer
2 REPLIES 2

Try all lower case.

Peter McLennan
Gondwana Software
Best Answer

Dear Catplace

Thank you for your answer.
The problem has been solved.
thank you very much.

Best Answer