DOM.HTMLOptionElement

KDE 4.7 PyKDE API Reference

- KDE's Python API

# HTMLOptionElement Class Reference

`from PyKDE4.khtml import *`

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

## Detailed Description

A selectable choice. See the <a href="http://www.w3.org/TR/REC-html40/interact/forms.html#edef-OPTION"> OPTION element definition in HTML 4.0.

## Methods
| __init__ (self)
| __init__ (self, DOM.HTMLOptionElement other)
| __init__ (self, DOM.Node other)
bool | defaultSelected (self)
bool | disabled (self)
DOM.HTMLFormElement | form (self)
long | index (self)
DOM.DOMString | label (self)
bool | selected (self)
| setDefaultSelected (self, bool a0)
| setDisabled (self, bool a0)
| setIndex (self, long a0)
| setLabel (self, DOM.DOMString a0)
| setSelected (self, bool a0)
| setValue (self, DOM.DOMString a0)
DOM.DOMString | text (self)
DOM.DOMString | value (self)

## Method Documentation

__init__ | ( |  | self ) |

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

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

bool defaultSelected | ( |  | self ) |

Stores the initial value of the selected attribute.

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.

DOM.HTMLFormElement form | ( |  | self ) |

### KDE 4.0: remove

long index | ( |  | self ) |

The index of this OPTION in its parent SELECT .

DOM.DOMString label | ( |  | self ) |

Option label for use in hierarchical menus. See the <a href="http://www.w3.org/TR/REC-html40/interact/forms.html#adef-label-OPTION"> label attribute definition in HTML 4.0.

bool selected | ( |  | self ) |

Means that this option is initially selected. See the <a href="http://www.w3.org/TR/REC-html40/interact/forms.html#adef-selected"> selected attribute definition in HTML 4.0.

setDefaultSelected | ( | self, |
|  | bool | a0
| ) |  |  |

see defaultSelected

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

see disabled

setIndex | ( | self, |
|  | long | a0
| ) |  |  |

see index

This function is obsolete - the index property is actually supposed to be read-only (http://www.w3.org/DOM/updates/REC-DOM-Level-1-19981001-errata.html)

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

see label

setSelected | ( | self, |
|  | bool | a0
| ) |  |  |

see selected

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

see value

DOM.DOMString text | ( |  | self ) |

The text contained within the option element.

DOM.DOMString value | ( |  | self ) |

The current form control value. See the <a href="http://www.w3.org/TR/REC-html40/interact/forms.html#adef-value-OPTION"> value attribute definition in HTML 4.0.