D
D
DadFild2015-10-22 02:38:14
JavaScript
DadFild, 2015-10-22 02:38:14

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

1 answer(s)
S
Stalker_RED, 2015-10-22
@DadFild

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 question

Ask a Question

731 491 924 answers to any question