+ 1
Why is this button not hiding on clicking
Button not hiding https://code.sololearn.com/WeC5wER8RH2X/?ref=app
2 Answers
+ 1
querySelector is similar to CSS selector
If you target an element by id you need to use a '#' in front of the id.
+ 1
ODLNT you are right. But it will still have problems with querySelector on the mobile version of SoloLearn, or with func() on the Desktop version. As you noted here: https://www.sololearn.com/Discuss/2783211/why-the-code-is-not-working
He would need to write window.func = function(){} instead of function func(){}.
And something to do with querySelector for the mobile version - right now it outputs null even if it's "#e" or just "button". If you put it directly in window.func , it works fine.