Checks if the given element has an anchor with the specified anchor name.
whether the element contains the anchor, even if nested
the anchor name to check for