New course! Every coder should learn Generative AI!
Try a free lesson+ 3
Why can't i change color of text by js here ? O.o
1 Answer
+ 1
Here is the corrected code :))
window.onload = () => {
var p = document
.getElementsByTagName("p")[0];
p.style.color="red";
}