Fix the error! | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

Fix the error!

Try to click the button , why all these text are coming. Please solve the problem https://code.sololearn.com/WgiC7hIT1j8q/?ref=app

1st Jan 2019, 11:40 AM
Ashwani Kumar
Ashwani Kumar - avatar
3 Answers
+ 5
the bug seems to be from the use of the "*" selector.please select your elements individually or assign a class to them. https://code.sololearn.com/WJyP6m4j9pUV/?ref=app
1st Jan 2019, 1:01 PM
᠌᠌Brains[Abidemi]
᠌᠌Brains[Abidemi] - avatar
+ 2
Brain , the * symbol select all the element of the document then why the error come?
1st Jan 2019, 2:02 PM
Ashwani Kumar
Ashwani Kumar - avatar
0
use this instead $("body *").css("color", "red") it works by selecting all the element of body tag The error was due to the fact that * includes all the elements of DOM which includes head too.
7th Jan 2019, 5:44 AM
Mayank Dhillon
Mayank Dhillon - avatar