KDE 4.7 PyKDE API Reference

- KDE's Python API

# HTMLSelectElement Class Reference

`from PyKDE4.khtml import *`

Inherits: DOM.HTMLElement → DOM.Element → DOM.Node
Namespace: DOM

## Detailed Description

The select element allows the selection of an option. The contained options can be directly accessed through the select element as a collection. See the <a href="http://www.w3.org/TR/REC-html40/interact/forms.html#edef-SELECT"> SELECT element definition in HTML 4.0.

## Methods
| __init__ (self)
| __init__ (self, DOM.HTMLSelectElement other)
| __init__ (self, DOM.Node other)
| add (self, DOM.HTMLElement element, DOM.HTMLElement before)
| blur (self)
bool | disabled (self)
| focus (self)
DOM.HTMLFormElement | form (self)
long | length (self)
bool | multiple (self)
DOM.DOMString | name (self)
DOM.HTMLCollection | options (self)
| remove (self, long index)
long | selectedIndex (self)
| setDisabled (self, bool a0)
| setMultiple (self, bool a0)
| setName (self, DOM.DOMString a0)
| setSelectedIndex (self, long a0)
| setSize (self, long a0)
| setTabIndex (self, long a0)
| setValue (self, DOM.DOMString a0)
long | size (self)
long | tabIndex (self)
DOM.DOMString | type (self)
DOM.DOMString | value (self)

## Method Documentation

__init__ | ( |  | self ) |

__init__ | ( | self, |
|  | DOM.HTMLSelectElement | other
| ) |  |  |

__init__ | ( | self, |
|  | DOM.Node | other
| ) |  |  |

add | ( | self, |
|  | DOM.HTMLElement | element,
|  | DOM.HTMLElement | before
| ) |  |  |

Add a new element to the collection of OPTION elements for this SELECT .

Parameters:

  | element | The element to add.
  | before | The element to insert before, or 0 for the tail of the list.

blur | ( |  | self ) |

Removes keyboard focus from this element.

bool disabled | ( |  | self ) |

The control is unavailable in this context. See the <a href="http://www.w3.org/TR/REC-html40/interact/forms.html#adef-disabled"> disabled attribute definition in HTML 4.0.

focus | ( |  | self ) |

Gives keyboard focus to this element.

DOM.HTMLFormElement form | ( |  | self ) |

### KDE 4.0: remove.

long length | ( |  | self ) |

The number of options in this SELECT .

bool multiple | ( |  | self ) |

If true, multiple OPTION elements may be selected in this SELECT . See the <a href="http://www.w3.org/TR/REC-html40/interact/forms.html#adef-multiple"> multiple attribute definition in HTML 4.0.

DOM.DOMString name | ( |  | self ) |

Form control or object name when submitted with a form. See the <a href="http://www.w3.org/TR/REC-html40/interact/forms.html#adef-name-SELECT"> name attribute definition in HTML 4.0.

DOM.HTMLCollection options | ( |  | self ) |

The collection of OPTION elements contained by this element.

remove | ( | self, |
|  | long | index
| ) |  |  |

Remove an element from the collection of OPTION elements for this SELECT . Does nothing if no element has the given index.

Parameters:

  | index | The index of the item to remove.

long selectedIndex | ( |  | self ) |

The ordinal index of the selected option. The value -1 is returned if no element is selected. If multiple options are selected, the index of the first selected option is returned.

setDisabled | ( | self, |
|  | bool | a0
| ) |  |  |

see disabled

setMultiple | ( | self, |
|  | bool | a0
| ) |  |  |

see multiple

setName | ( | self, |
|  | DOM.DOMString | a0
| ) |  |  |

see name

setSelectedIndex | ( | self, |
|  | long | a0
| ) |  |  |

see selectedIndex

setSize | ( | self, |
|  | long | a0
| ) |  |  |

see size

setTabIndex | ( | self, |
|  | long | a0
| ) |  |  |

see tabIndex

setValue | ( | self, |
|  | DOM.DOMString | a0
| ) |  |  |

see value

long size | ( |  | self ) |

Number of visible rows. See the <a href="http://www.w3.org/TR/REC-html40/interact/forms.html#adef-size-SELECT"> size attribute definition in HTML 4.0.

long tabIndex | ( |  | self ) |

Index that represents the element's position in the tabbing order. See the <a href="http://www.w3.org/TR/REC-html40/interact/forms.html#adef-tabindex"> tabindex attribute definition in HTML 4.0.

DOM.DOMString type | ( |  | self ) |

The type of control created.

DOM.DOMString value | ( |  | self ) |

The current form control value.