```js
// This sample shows how the getItems() method can be used to obtain a list
// of all the top-level microdata items of one type given in the document:
var cats = document.getItems("http://example.com/feline");
```
```js
// This sample gets the first item of type "http://example.net/user"
// and then pops up an alert using the "name" property from that item.
var user = document.getItems('http://example.net/user')[0];
alert('Hello ' + user.properties['name'][0].content + '!');
```
```js
// The HTMLPropertiesCollection object, when indexed by name in this way,
// actually returns a PropertyNodeList object with all the matching properties.
// The PropertyNodeList object can be used to obtain all the values at once
// using its values attribute, which returns an array of all the values.
var cat = document.getItems('http://example.org/animals#cat')[0];
var colors = cat.properties['http://example.com/color'].values;
var result;
if (colors.length == 0) {
result = 'Color unknown.';
} else if (colors.length == 1) {
result = 'Color: ' + colors[0];
} else {
result = 'Colors:';
for (var i = 0; i < colors.length; i += 1)
result += ' ' + colors[i];
}
```