I'm trying to get to the div class="article" nested inside a div called div id="tabs=main from this a HTML-page that looks like this:
I have tried something like this but with no result:
var targetAbs = doc.querySelectorAll("article");
Anyone have any tips for me? Not even sure I'm suppose to use this queryselector. I have also tried the getElementsByClassName, but I think since it's nested I can reach it.
doc isn't a standard variable provided by the browser. You are looking for
Class selectors begin with a
"article" is a type selector and will match
As your element has a class of
article, you need to use the following code:
You need to place a
. in front of the selector when it is referring to a class.