6

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

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

In the example above, is the itemprop's value the href attribute, much like how the link tag is parsed? Or is the value the innerHTML, as a standard block element is parsed?

I've searched quite a bit and cannot find the answer. I'm open to all answers, but I'd very much like a source for the answers given so I can further investigate.

Thanks in advance!

Swivel
  • 3,020
  • 26
  • 36
  • 1
    Note that the value of ordinary elements like div and spans is not their innerHTML value but their textContent value. See http://www.whatwg.org/specs/web-apps/current-work/multipage/microdata.html#values for the full details. – Alohci Nov 28 '13 at 00:32

2 Answers2

9

The Microdata spec (which is now merely W3C Note) defines:

If the element is an a, area, or link element
The value is the absolute URL that results from resolving the value of the element's href attribute relative to the element at the time the attribute is set, or the empty string if there is no such attribute or if resolving it results in an error.

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

unor
  • 92,415
  • 26
  • 211
  • 360
4

It seems I found the answer not long after posting this. However, rather than deleting the question, I'm sure there are others out there who are wondering the same thing.

The short answer is: It uses the href attribute.

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

Swivel
  • 3,020
  • 26
  • 36