|
NAMEHTML::DOM::Collection::Elements - A subclass of HTML::DOM::Collection for form elementsVERSIONVersion 0.054SYNOPSISuse HTML::DOM; $doc = HTML::DOM->new; $doc->write(' <form> <input name=r type=radio value=1> <input name=r type=radio value=2> </form> '); $doc->close; $elements = $doc->forms->[0]->elements; # returns an HTML::DOM::Collection::Elements object $elements->[0]; # first radio button $elements->item(0); # same $elements->{r}; # an array of buttons named 'r' $elements->namedItem('r'); # same () = $elements->namedItem('r'); # list, not array $elements->length; # same as scalar @$elements DESCRIPTIONThis implements the HTMLCollection interface as described in the W3C's DOM standard, except that the "namedItem" method (and the corresponding hash dereference) will return a list of form elements if there are several with the same name. This is actually in violation of the DOM standard, but it is in accordance with the way most web browsers work (at least Safari and Firefox).CONSTRUCTORNormally you would simply call HTML::DOM::Element::Form's "elements" method (as in the "SYNOPSIS"). But if you wall to call the constructor anyway, here is the syntax:$elements = HTML::DOM::Collection::Elements->new($nodelist) $nodelist should be a node list (HTML::DOM::NodeList) object. METHODS
SEE ALSOHTML::DOMHTML::DOM::Collection HTML::DOM::Element::Form HTML::DOM::NodeList (manpage not written yet) HTML::DOM::NodeList::Magic (manpage not written yet)
Visit the GSP FreeBSD Man Page Interface. |