Answer the question
In order to leave comments, you need to log in
How to check if an element is not placed at noindex?
There was such task
there is an element <a href="#"><img src="img.png"></a>
It is necessary to check whether it is located inside the noindex tag using pure javascript.
those. check if element indexing is disabled.
How to do it?
Answer the question
In order to leave comments, you need to log in
there is such a thing as .closest()
demo: jsfiddle.net/y5vsnk6j
True support is not very good yet https://developer.mozilla.org/en/docs/Web/API/Elem...
But there is a polyfill https://learn .javascript.ru/task/polyfill-closest
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question