Name
MediaList.item( ) — index an array of media types
Availability
DOM Level 2 StyleSheets
Synopsis
String item(unsigned long index
);
Arguments
-
index
The position of the desired media type within the array.
Returns
The media type (a string) at the specified position within the
MediaList, or null
if
index
is negative or is greater than or
equal to length
. Note that in JavaScript, it is
usually simpler to treat a MediaList object as an array and index it
using square-bracket array notation instead of calling this
method.
Get JavaScript: The Definitive Guide, Fourth Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.