Skip to content

Instantly share code, notes, and snippets.

@clochix
Created June 8, 2012 14:42
Show Gist options
  • Save clochix/2895977 to your computer and use it in GitHub Desktop.
Save clochix/2895977 to your computer and use it in GitHub Desktop.
Microdata exploration
var items = document.getItems();
if (items.length > 0) {
Array.prototype.forEach.call(items, function (elmt) {
console.log(elmt);
console.log(elmt.itemId, elmt.itemProp.value, elmt.itemRef.value, elmt.itemType.value, elmt.itemValue);
Array.prototype.forEach.call(elmt.properties, function (prop) {
console.log(' ⇒ ' + prop.itemProp.value + ' : ' + (prop.content || prop.itemValue), prop);
})
})
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment