\section{DOM::HTMLCollection Class Reference}
\label{classDOM_1_1HTMLCollection}\index{DOM::HTMLCollection@{DOM::HTMLCollection}}
An {\tt {\bf HTMLCollection}{\rm (p.\,\pageref{classDOM_1_1HTMLCollection})}} is a list of nodes.  


{\tt \#include $<$html\_\-misc.h$>$}

\subsection*{Public Member Functions}
\begin{CompactItemize}
\item 
{\bf HTMLCollection} (const {\bf HTMLCollection} \&other)\label{classDOM_1_1HTMLCollection_a1}

\item 
{\bf HTMLCollection} \& {\bf operator=} (const {\bf HTMLCollection} \&other)\label{classDOM_1_1HTMLCollection_a2}

\item 
unsigned long {\bf length} () const 
\item 
{\bf Node} {\bf item} (unsigned long index) const 
\item 
{\bf Node} {\bf named\-Item} (const {\bf DOMString} \&name) const 
\item 
{\bf Node} {\bf base} () const \label{classDOM_1_1HTMLCollection_a7}

\item 
HTMLCollection\-Impl $\ast$ {\bf handle} () const \label{classDOM_1_1HTMLCollection_a8}

\item 
bool {\bf is\-Null} () const \label{classDOM_1_1HTMLCollection_a9}

\item 
{\bf Node} {\bf first\-Item} () const \label{classDOM_1_1HTMLCollection_a10}

\item 
{\bf Node} {\bf next\-Item} () const \label{classDOM_1_1HTMLCollection_a11}

\item 
{\bf Node} {\bf next\-Named\-Item} (const {\bf DOMString} \&name) const \label{classDOM_1_1HTMLCollection_a12}

\end{CompactItemize}
\subsection*{Protected Member Functions}
\begin{CompactItemize}
\item 
{\bf HTMLCollection} (Node\-Impl $\ast$base, int type)\label{classDOM_1_1HTMLCollection_b0}

\end{CompactItemize}
\subsection*{Protected Attributes}
\begin{CompactItemize}
\item 
HTMLCollection\-Impl $\ast$ {\bf impl}\label{classDOM_1_1HTMLCollection_p0}

\end{CompactItemize}
\subsection*{Friends}
\begin{CompactItemize}
\item 
class {\bf HTMLDocument}\label{classDOM_1_1HTMLCollection_n0}

\item 
class {\bf HTMLSelect\-Element}\label{classDOM_1_1HTMLCollection_n1}

\item 
class {\bf HTMLImage\-Element}\label{classDOM_1_1HTMLCollection_n2}

\item 
class {\bf HTMLMap\-Element}\label{classDOM_1_1HTMLCollection_n3}

\item 
class {\bf HTMLTable\-Element}\label{classDOM_1_1HTMLCollection_n4}

\item 
class {\bf HTMLTable\-Row\-Element}\label{classDOM_1_1HTMLCollection_n5}

\item 
class {\bf HTMLTable\-Section\-Element}\label{classDOM_1_1HTMLCollection_n6}

\item 
class {\bf HTMLLayer\-Element}\label{classDOM_1_1HTMLCollection_n7}

\item 
class {\bf HTMLElement}\label{classDOM_1_1HTMLCollection_n8}

\end{CompactItemize}


\subsection{Detailed Description}
An {\tt {\bf HTMLCollection}{\rm (p.\,\pageref{classDOM_1_1HTMLCollection})}} is a list of nodes. 

An individual node may be accessed by either ordinal index or the node's {\tt name} or {\tt id} attributes. Note: Collections in the HTML {\bf DOM}{\rm (p.\,\pageref{namespaceDOM})} are assumed to be live meaning that they are automatically updated when the underlying document is changed. 



Definition at line 126 of file html\_\-misc.h.

\subsection{Member Function Documentation}
\index{DOM::HTMLCollection@{DOM::HTMLCollection}!length@{length}}
\index{length@{length}!DOM::HTMLCollection@{DOM::HTMLCollection}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}unsigned long HTMLCollection::length () const}\label{classDOM_1_1HTMLCollection_a4}


This attribute specifies the length or size of the list. 



Definition at line 141 of file html\_\-misc.cpp.

References DOM::DOMString::length().

Referenced by DOM::HTMLForm\-Element::length().\index{DOM::HTMLCollection@{DOM::HTMLCollection}!item@{item}}
\index{item@{item}!DOM::HTMLCollection@{DOM::HTMLCollection}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf Node} HTMLCollection::item (unsigned long {\em index}) const}\label{classDOM_1_1HTMLCollection_a5}


This method retrieves a node specified by ordinal index. 

Nodes are numbered in tree order (depth-first traversal order).

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em index}]The index of the node to be fetched. The index origin is 0.\end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]The {\tt {\bf Node}{\rm (p.\,\pageref{classDOM_1_1Node})}} at the corresponding position upon success. A value of {\tt null} is returned if the index is out of range. \end{Desc}


Definition at line 147 of file html\_\-misc.cpp.\index{DOM::HTMLCollection@{DOM::HTMLCollection}!namedItem@{namedItem}}
\index{namedItem@{namedItem}!DOM::HTMLCollection@{DOM::HTMLCollection}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf Node} HTMLCollection::named\-Item (const {\bf DOMString} \& {\em name}) const}\label{classDOM_1_1HTMLCollection_a6}


This method retrieves a {\tt {\bf Node}{\rm (p.\,\pageref{classDOM_1_1Node})}} using a name. 

It first searches for a {\tt {\bf Node}{\rm (p.\,\pageref{classDOM_1_1Node})}} with a matching {\tt id} attribute. If it doesn't find one, it then searches for a {\tt {\bf Node}{\rm (p.\,\pageref{classDOM_1_1Node})}} with a matching {\tt name} attribute, but only on those elements that are allowed a name attribute.

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em name}]The name of the {\tt {\bf Node}{\rm (p.\,\pageref{classDOM_1_1Node})}} to be fetched.\end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]The {\tt {\bf Node}{\rm (p.\,\pageref{classDOM_1_1Node})}} with a {\tt name} or {\tt id} attribute whose value corresponds to the specified string. Upon failure (e.g., no node with this name exists), returns {\tt null} . \end{Desc}


Definition at line 153 of file html\_\-misc.cpp.

The documentation for this class was generated from the following files:\begin{CompactItemize}
\item 
html\_\-misc.h\item 
html\_\-misc.cpp\end{CompactItemize}
