[][src]Struct stdweb::web::html_element::SelectElement

pub struct SelectElement(_);

The HTML <select> element represents a control that provides a menu of options.

(JavaScript docs)

Methods

impl SelectElement[src]

pub fn raw_value(&self) -> String[src]

Returns the value attribute of the first selected <option> element or if it is missing, the text attribute. If there is no selection, return empty string. This method is just a wrapper for getting HTMLSelectElement.value directly

pub fn set_raw_value(&self, value: &str)[src]

Set the given value to HTMLSelectElement.value directly.

pub fn selected_index(&self) -> Option<u32>[src]

Returns the Some(index) of the first selected item, if any, or None if there is no selected item.

pub fn set_selected_index(&self, selected_index: Option<u32>)[src]

Change selected index to the given value.

pub fn value(&self) -> Option<String>[src]

Returns the Some(value) of the first selected item, if any, or None if there is no selected item.

pub fn set_value(&self, value: Option<&str>) -> Result<(), UnknownValueError>[src]

Change the selected value to the given value. If you provide an invalid value, the <select> element will have no item selected, and an UnknownValueError is returned.

pub fn multiple(&self) -> bool[src]

Indicates whether multiple items can be selected

pub fn selected_options(&self) -> HtmlCollection[src]

An HtmlCollection representing the set of <option> elements that are selected.

pub fn selected_values(&self) -> Vec<String>[src]

A convenience method to get values of all selected <option> elements

pub fn selected_indices(&self) -> Vec<i32>[src]

A convenience method to get indices of all selected <option> elements

Trait Implementations

impl JsSerialize for SelectElement[src]

impl TryFrom<EventTarget> for SelectElement[src]

type Error = ConversionError

The type returned in the event of a conversion error.

impl TryFrom<Node> for SelectElement[src]

type Error = ConversionError

The type returned in the event of a conversion error.

impl TryFrom<Element> for SelectElement[src]

type Error = ConversionError

The type returned in the event of a conversion error.

impl TryFrom<HtmlElement> for SelectElement[src]

type Error = ConversionError

The type returned in the event of a conversion error.

impl TryFrom<SelectElement> for Reference[src]

type Error = Void

The type returned in the event of a conversion error.

impl TryFrom<Reference> for SelectElement[src]

type Error = ConversionError

The type returned in the event of a conversion error.

impl<'_r> TryFrom<&'_r Reference> for SelectElement[src]

type Error = ConversionError

The type returned in the event of a conversion error.

impl TryFrom<Value> for SelectElement[src]

type Error = ConversionError

The type returned in the event of a conversion error.

impl<'_r> TryFrom<&'_r Value> for SelectElement[src]

type Error = ConversionError

The type returned in the event of a conversion error.

impl InstanceOf for SelectElement[src]

impl ReferenceType for SelectElement[src]

impl IEventTarget for SelectElement[src]

impl INode for SelectElement[src]

impl IElement for SelectElement[src]

impl IHtmlElement for SelectElement[src]

impl AsRef<Reference> for SelectElement[src]

impl From<SelectElement> for EventTarget[src]

impl From<SelectElement> for Node[src]

impl From<SelectElement> for Element[src]

impl From<SelectElement> for HtmlElement[src]

impl From<SelectElement> for Reference[src]

impl Clone for SelectElement[src]

impl Eq for SelectElement[src]

impl PartialEq<SelectElement> for SelectElement[src]

impl Debug for SelectElement[src]

Auto Trait Implementations

Blanket Implementations

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> From<T> for T[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]