Trait stdweb::traits::IElement
[−]
[src]
pub trait IElement: INode + IParentNode + IChildNode { fn class_list(&self) -> TokenList { ... } fn has_attribute(&self, name: &str) -> bool { ... } fn get_attribute(&self, name: &str) -> Option<String> { ... } fn set_attribute(
&self,
name: &str,
value: &str
) -> Result<(), InvalidCharacterError> { ... } fn scroll_top(&self) -> f64 { ... } fn set_scroll_top(&self, value: f64) { ... } fn scroll_left(&self) -> f64 { ... } fn set_scroll_left(&self, value: f64) { ... } fn get_attribute_names(&self) -> Vec<String> { ... } fn remove_attribute(&self, name: &str) { ... } fn has_attributes(&self) -> bool { ... } fn set_pointer_capture(
&self,
pointer_id: i32
) -> Result<(), InvalidPointerId> { ... } fn release_pointer_capture(
&self,
pointer_id: i32
) -> Result<(), InvalidPointerId> { ... } fn has_pointer_capture(&self, pointer_id: i32) -> bool { ... } }
The IElement
interface represents an object of a Document.
This interface describes methods and properties common to all
kinds of elements.
Provided Methods
fn class_list(&self) -> TokenList
The Element.classList is a read-only property which returns a live TokenList collection of the class attributes of the element.
fn has_attribute(&self, name: &str) -> bool
The Element.hasAttribute() method returns a Boolean value indicating whether the specified element has the specified attribute or not.
fn get_attribute(&self, name: &str) -> Option<String>
Element.getAttribute() returns the value of a specified attribute on the element. If the given attribute does not exist, the value returned will either be null or "" (the empty string);
fn set_attribute(
&self,
name: &str,
value: &str
) -> Result<(), InvalidCharacterError>
&self,
name: &str,
value: &str
) -> Result<(), InvalidCharacterError>
Sets the value of an attribute on the specified element. If the attribute already exists, the value is updated; otherwise a new attribute is added with the specified name and value.
fn scroll_top(&self) -> f64
Gets the the number of pixels that an element's content is scrolled vertically.
fn set_scroll_top(&self, value: f64)
Sets the the number of pixels that an element's content is scrolled vertically.
fn scroll_left(&self) -> f64
Gets the the number of pixels that an element's content is scrolled to the left.
fn set_scroll_left(&self, value: f64)
Sets the the number of pixels that an element's content is scrolled to the left.
fn get_attribute_names(&self) -> Vec<String>
Element.getAttributeNames() returns the attribute names of the element as an Array of strings. If the element has no attributes it returns an empty array.
fn remove_attribute(&self, name: &str)
Element.removeAttribute removes an attribute from the specified element.
fn has_attributes(&self) -> bool
The Element.hasAttributes() method returns Boolean value, indicating if the current element has any attributes or not.
fn set_pointer_capture(&self, pointer_id: i32) -> Result<(), InvalidPointerId>
Designates a specific element as the capture target of future pointer events.
fn release_pointer_capture(
&self,
pointer_id: i32
) -> Result<(), InvalidPointerId>
&self,
pointer_id: i32
) -> Result<(), InvalidPointerId>
Releases pointer capture that was previously set for a specific pointer
fn has_pointer_capture(&self, pointer_id: i32) -> bool
Returns a boolean indicating if the element has captured the specified pointer
Implementors
impl IElement for Element
impl IElement for HtmlElement
impl IElement for CanvasElement
impl IElement for ImageElement
impl IElement for InputElement
impl IElement for TextAreaElement
impl IElement for SelectElement
impl IElement for OptionElement