[−][src]Struct web_sys_query::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]
&self,
selectors: Option<&Selectors>
) -> Result<Collection, Error>
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.
pub fn deref(&self) -> &Self::Target
[src]
impl DerefMut for Element
[src]
impl Display for Element
[src]
impl Element for Element
[src]
type Impl = SelectorTypes
pub fn opaque(&self) -> OpaqueElement
[src]
pub fn parent_element(&self) -> Option<Self>
[src]
pub fn parent_node_is_shadow_root(&self) -> bool
[src]
pub fn containing_shadow_host(&self) -> Option<Self>
[src]
pub fn is_pseudo_element(&self) -> bool
[src]
pub fn prev_sibling_element(&self) -> Option<Self>
[src]
pub fn next_sibling_element(&self) -> Option<Self>
[src]
pub fn is_html_element_in_html_document(&self) -> bool
[src]
pub fn has_local_name(
&self,
local_name: &<Self::Impl as SelectorImpl>::BorrowedLocalName
) -> bool
[src]
&self,
local_name: &<Self::Impl as SelectorImpl>::BorrowedLocalName
) -> bool
pub fn has_namespace(
&self,
ns: &<Self::Impl as SelectorImpl>::BorrowedNamespaceUrl
) -> bool
[src]
&self,
ns: &<Self::Impl as SelectorImpl>::BorrowedNamespaceUrl
) -> bool
pub fn is_same_type(&self, other: &Self) -> bool
[src]
pub fn attr_matches(
&self,
ns: &NamespaceConstraint<&<Self::Impl as SelectorImpl>::NamespaceUrl>,
local_name: &<Self::Impl as SelectorImpl>::LocalName,
operation: &AttrSelectorOperation<&<Self::Impl as SelectorImpl>::AttrValue>
) -> bool
[src]
&self,
ns: &NamespaceConstraint<&<Self::Impl as SelectorImpl>::NamespaceUrl>,
local_name: &<Self::Impl as SelectorImpl>::LocalName,
operation: &AttrSelectorOperation<&<Self::Impl as SelectorImpl>::AttrValue>
) -> bool
pub fn match_non_ts_pseudo_class<F>(
&self,
pc: &<Self::Impl as SelectorImpl>::NonTSPseudoClass,
_context: &mut MatchingContext<'_, Self::Impl>,
_flags_setter: &mut F
) -> bool where
F: FnMut(&Self, ElementSelectorFlags),
[src]
&self,
pc: &<Self::Impl as SelectorImpl>::NonTSPseudoClass,
_context: &mut MatchingContext<'_, Self::Impl>,
_flags_setter: &mut F
) -> bool where
F: FnMut(&Self, ElementSelectorFlags),
pub fn match_pseudo_element(
&self,
pe: &<Self::Impl as SelectorImpl>::PseudoElement,
_context: &mut MatchingContext<'_, Self::Impl>
) -> bool
[src]
&self,
pe: &<Self::Impl as SelectorImpl>::PseudoElement,
_context: &mut MatchingContext<'_, Self::Impl>
) -> bool
pub fn is_link(&self) -> bool
[src]
pub fn is_html_slot_element(&self) -> bool
[src]
pub fn assigned_slot(&self) -> Option<Self>
[src]
pub fn has_id(
&self,
id: &<Self::Impl as SelectorImpl>::Identifier,
case_sensitivity: CaseSensitivity
) -> bool
[src]
&self,
id: &<Self::Impl as SelectorImpl>::Identifier,
case_sensitivity: CaseSensitivity
) -> bool
pub fn has_class(
&self,
name: &<Self::Impl as SelectorImpl>::ClassName,
case_sensitivity: CaseSensitivity
) -> bool
[src]
&self,
name: &<Self::Impl as SelectorImpl>::ClassName,
case_sensitivity: CaseSensitivity
) -> bool
pub fn exported_part(
&self,
_name: &<Self::Impl as SelectorImpl>::PartName
) -> Option<<Self::Impl as SelectorImpl>::PartName>
[src]
&self,
_name: &<Self::Impl as SelectorImpl>::PartName
) -> Option<<Self::Impl as SelectorImpl>::PartName>
pub fn imported_part(
&self,
_name: &<Self::Impl as SelectorImpl>::PartName
) -> Option<<Self::Impl as SelectorImpl>::PartName>
[src]
&self,
_name: &<Self::Impl as SelectorImpl>::PartName
) -> Option<<Self::Impl as SelectorImpl>::PartName>
pub fn is_part(&self, _name: &<Self::Impl as SelectorImpl>::PartName) -> bool
[src]
pub fn is_empty(&self) -> bool
[src]
pub fn is_root(&self) -> bool
[src]
pub fn pseudo_element_originating_element(&self) -> Option<Self>
[src]
pub fn ignores_nth_child_selectors(&self) -> bool
[src]
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.
pub fn try_from(document: &Document) -> Result<Element, Self::Error>
[src]
impl<'a> TryInto<&'a HtmlElement> for &'a Element
[src]
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]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,