GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
HTML::DOM::Element::Select(3) User Contributed Perl Documentation HTML::DOM::Element::Select(3)

HTML::DOM::Element::Select - A Perl class for representing 'select' elements in an HTML DOM tree

Version 0.054

  use HTML::DOM;
  $doc = HTML::DOM->new;
  $elem = $doc->createElement('select');
  $elem->focus();
  $elem->blur();
  
  # $elem->add(...)    # not yet
  # $elem->remove(...) # implemented
  $elem->options; # a list of 'option' elements
  $elem->name('foo') # set attribute
  $elem->type;       # get attribute
  $elem->tagName;
  # etc.
  $elem->[0]; # first option
  $elem->[1] = $doc->createElement('option');
  $elem->[0] = undef; # deletes it
  delete $elem->[0]; # same

This class implements 'select' elements in an HTML::DOM tree. It implements the HTMLSelectElement DOM interface and inherits from HTML::DOM::Element (q.v.).

You can use a 'select' element as an array reference, to access the individual elements of its options array. @$elem actually does exactly the same thing as "@{$elem->options}". See HTML::DOM::Collection::Options for more info on using the array.

In addition to those inherited from HTML::DOM::Element and its superclasses, this class implements the following DOM methods:

Each of these returns the corresponding HTML attribute. If you pass an argument, it will become the new value of the attribute, and the old value will be returned.
Returns the index of the selected option. If there is an argument, it selects the specified option and returns the index of the previous selection.
Returns the number of options.
Returns the form containing this input element.
Returns a list of 'option' elements in list context, or an HTML::DOM::Collection::Options object in scalar context.
Selects the option with the value given if there is an argument and returns the old value, or simply returns the value if there is no argument.
These each trigger the corresponding event.

In addition, the following methods are provided for compatibility with WWW::Mechanize:

This returns an empty list for most input elements, but for checkboxes it returns "(undef, $value)".
An alias to readOnly.
Returns a list of two items: (0) the name of the field and (1) the value.
Same as "$elem->checked(1)".

HTML::DOM

HTML::DOM::Collection::Options

HTML::DOM::Element

HTML::DOM::Element::Form

2014-12-23 perl v5.40.2

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.