Can someone explain wrong output for clicking first two elements of the page from this code? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Can someone explain wrong output for clicking first two elements of the page from this code?

Get unique selector of clicked HTML element https://code.sololearn.com/WMAZk7B2MOk9/?ref=app

12th Sep 2017, 1:56 AM
Razum.Top
Razum.Top - avatar
3 Answers
0
I found the solution: instead of using ' ' (space) as separator between nested levels of selector should use '>'. So selectors look like BODY>:NTH-CHILD(1).
5th Oct 2017, 12:53 AM
Razum.Top
Razum.Top - avatar
0
What incorrect output?
13th Sep 2017, 9:24 PM
josh mizzi
josh mizzi - avatar
0
For example, if you clicked the "First paragraph" it outputs: ================= You've clicked "First paragraphGrandchildGrandchildSecond div header". It's unique selector isBODY :NTH-CHILD(1) ================== But should output just: ++++++++++++++++++ You've clicked "First paragraph". It's unique selector is BODY :NTH-CHILD(1) ++++++++++++++++++ Why there is other elements content?
14th Sep 2017, 3:33 AM
Razum.Top
Razum.Top - avatar