How is a tag binding value determined using Microdata?

How do Google and others determine the value of itemprop in an Anchor tag?

  <a href="foo.html" itemprop="barprop">Name Of Link</a> 

In the above example, is the itemprop value the href attribute, similar to how the link tag is parsed? Or is this innerHTML value when a standard block element is parsed?

I searched quite a bit and can not find the answer. I am open to all the answers, but I really liked the source of the answers, so I can continue the investigation.

Thanks in advance!

+5
source share
2 answers

The Microdata specification (now just a W3C note) defines :

If the element is an a , area or link element
The value is an absolute URL that results from resolving the value of the element href attribute relative to the element when setting the attribute or an empty string, if there is no such attribute or if its removal leads to an error.

Exception: if the a / area / link element has the itemscope attribute, then the itemprop value "is the element created by the element" and not the href value.

+8
source

I seem to have found the answer shortly after posting this. However, instead of deleting this question, I am sure that there are others who are asking the same question.

Short answer: it uses the href attribute.

A long answer can be found here: http://schema.org/docs/gs.html#advanced_canonical

+3
source

Source: https://habr.com/ru/post/954707/


All Articles