HTML and CSS Reference
In-Depth Information
B.1.5. Microdata API
The Microdata API ( table B.12 ) has one method on the document object and a couple
of DOM attributes on elements that have Microdata content attributes ( itemscope and
itemprop ).
Table B.12. Microdata API
Attribute/method
Description
Returns a list of top-level Microdata items. If you're looking for a particular type of Mi-
crodata item, such as event items, you can select all event items by specifying 'ht-
tp://microformats.org/profile/hcalendar#event' as the type parameter. Multiple types can
be specified in a space-separated list.
document.getItems([type])
element.properties
Gets the element's attributes (only if it has an itemscope attribute).
element.itemValue
Gets or sets the element's Microdata item value (only if it has an itemprop attribute).
B.1.6. APIs for Web Storage
Web Storage defines APIs on two objects, window.localStorage and
window.session-Storage ; see table B.13 . The APIs for both of these objects are
identical.
Table B.13. localStorage and sessionStorage API
Attribute/method
Description
length
Number of items (key/value pairs) currently stored in the storage area.
key(index)
Gets the name of the key at the given index.
getItem(key)
Gets the value of the item at the given key.
setItem(key, value)
Sets the value of the item at the given key to the value provided.
removeItem(key)
Removes the item at the given key.
clear()
Removes all items in the storage area.
Web Storage also defines an event, storage , that fires when the storage area changes.
This event returns a storage event object, which contains attributes to determine what
changed; see table B.14 .
 
 
Search WWH ::




Custom Search