[][src]Struct web_sys_query::Element

pub struct Element(_);

Element with jQuery-like methods.

Implementations

impl Element[src]

pub fn add_class(&self, class: &str) -> Result<(), Error>[src]

Add CSS class.

pub fn attr(&self, key: &str) -> Option<String>[src]

Return the matching attribute, if found.

pub fn set_attr(&self, key: &str, value: &str) -> Result<(), Error>[src]

Set the attribute to the specified value.

pub fn has_class(&self, class: &str) -> bool[src]

Check if element has a matching CSS class.

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

Get the inner HTML of the element.

pub fn set_html(&self, html: &str)[src]

Set the inner HTML of the element.

pub fn remove_attr(&self, key: &str) -> Result<(), Error>[src]

Remove the attribute.

pub fn remove_class(&self, class: &str) -> Result<(), Error>[src]

Remove CSS class from list.

pub fn toggle_class(&self, class: &str) -> Result<bool, Error>[src]

Return the matching attribute, if found.

pub fn val(&self) -> Result<String, Error>[src]

pub fn val_f64(&self) -> Result<f64, Error>[src]

pub fn val_i32(&self) -> Result<i32, Error>[src]

pub fn set_val(&self, value: &str) -> Result<(), Error>[src]

pub fn set_val_f64(&self, value: f64) -> Result<(), Error>[src]

pub fn set_val_i32(&self, value: i32) -> Result<(), Error>[src]

impl Element[src]

pub fn text(&self) -> Result<String, Error>[src]

Get the inner text.

pub fn set_text(&self, text: &str) -> Result<(), Error>[src]

Set the inner text.

impl Element[src]

pub fn children(
    &self,
    selectors: Option<&Selectors>
) -> Result<Collection, Error>
[src]

pub fn find(&self, selectors: &Selectors) -> Result<Collection, Error>[src]

Find elements by selectors.

pub fn first(&mut self) -> Element[src]

pub fn last(&mut self) -> Element[src]

pub fn next(&self, selectors: Option<&Selectors>) -> Option<Self>[src]

pub fn parent(&self) -> Option<Self>[src]

pub fn prev(&self, selectors: Option<&Selectors>) -> Option<Self>[src]

impl Element[src]

pub fn descendants(&self) -> Collection[src]

pub fn dyn_ref<T: JsCast>(&self) -> Result<&T, Error>[src]

Trait Implementations

impl AsRef<Element> for Element[src]

impl Clone for Element[src]

impl Debug for Element[src]

impl Deref for Element[src]

type Target = Element

The resulting type after dereferencing.

impl DerefMut for Element[src]

impl Display for Element[src]

impl Element for Element[src]

type Impl = SelectorTypes

impl From<Element> for Element[src]

impl From<Element> for Element[src]

impl<'_> TryFrom<&'_ Document> for Element[src]

type Error = Error

The type returned in the event of a conversion error.

impl<'a> TryInto<&'a HtmlElement> for &'a Element[src]

type Error = Error

The type returned in the event of a conversion error.

Auto Trait Implementations

impl RefUnwindSafe for Element

impl !Send for Element

impl !Sync for Element

impl Unpin for Element

impl UnwindSafe for Element

Blanket Implementations

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

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

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

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

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

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

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized
[src]

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.