javaScript isn't style content | SoloLearn: Learn to code for FREE!


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.

6/27/2020 11:04:04 AM

Muhammad Usman

2 Answers

New Answer


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!


Thanks Abhay. Now it's working fine