I have a CSS selector
#menu li {background-color: red;}
.
I'm trying to retrieve its properties using JavaScript. It's crucial for me to access both the #menu
and li
elements separately as they have distinct attributes. Unfortunately, methods like
getElementById(menu li), QuerySelector and getComputedStyle
don't seem to be effective in this particular scenario.
Is there an alternative approach I can take or is there something I may be overlooking?