0
javaScript isn't style content
I tried the same code in another stylesheet, it was working properly. But it's not working in SoloLearn code player. I want to do some styles with section tag through javaScript. Kindly solve this BUGGgg. https://code.sololearn.com/Wy7F9cy7fbvU/?ref=app
2 Respostas
+ 5
window.onload=function(){
document.querySelector('section').style.width="50%";
}
To allow script to run only after document get loaded,you can search for similar answers to know about it it more detail!
0
Thanks Abhay.
Now it's working fine