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

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

6/27/2020 11:04:04 AM

Muhammad Usman

2 Answers

New Answer

+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