+ 2
The only possible reason i can think of is that sololearn platform runs the JS first before the HTML is loaded, so it is detecting the style being null. So I suggest the following instead: <!DOCTYPE html> <html> <head> <title>Page Title</title> </head> <body> <div id="Bing">hjw</div> </body> <script> var Bong=document.getElementById("Bing"); Bong.style.height="1px"; </script> </html> By putting the script at the bottom (instead of under JS tab), this ensures that the script is run after the HTML is loaded
2nd Oct 2017, 6:04 AM
Deddy Tandean
+ 1
U can try this with quotation mark: JoeyTribbiani.style.height = "1px"; It should work :)
2nd Oct 2017, 4:31 AM
Deddy Tandean
+ 1
what error did u experience? The result shd be showing you 1px height instead of 456px right away
2nd Oct 2017, 4:40 AM
Deddy Tandean
+ 1
Don't ask me why, but I changed the double quotations to single quotations and I think that I got it to work. Jo.style.height='1px';
2nd Oct 2017, 5:07 AM
Jeff Shipton
Jeff Shipton - avatar
2nd Oct 2017, 5:08 AM
Jeff Shipton
Jeff Shipton - avatar