pub struct InputElement(/* private fields */);
Expand description
The HTML input element is used to create interactive controls for web-based forms in order to accept data from the user.
Implementations§
Source§impl InputElement
impl InputElement
Sourcepub fn raw_value(&self) -> String
pub fn raw_value(&self) -> String
The value of the control. This attribute is optional except when the input is a radio button or a checkbox.
Sourcepub fn set_raw_value(&self, value: &str)
pub fn set_raw_value(&self, value: &str)
Sets the value of the control.
Sourcepub fn selection_start(&self) -> Option<u32>
pub fn selection_start(&self) -> Option<u32>
The offset to the start of the selection. This attribute only applies when the input is a text, search, url, telephone or password.
Sourcepub fn set_selection_start(&self, value: u32) -> Result<(), InvalidStateError>
pub fn set_selection_start(&self, value: u32) -> Result<(), InvalidStateError>
Sets the offset to the start of the selection. This attribute only applies when the input is a text, search, url, telephone or password.
Sourcepub fn selection_end(&self) -> Option<u32>
pub fn selection_end(&self) -> Option<u32>
The offset to the end of the selection. This attribute only applies when the input is a text, search, url, telephone or password.
Sourcepub fn set_selection_end(&self, value: u32) -> Result<(), InvalidStateError>
pub fn set_selection_end(&self, value: u32) -> Result<(), InvalidStateError>
Sets the offset to the end of the selection. This attribute only applies when the input is a text, search, url, telephone or password.
Trait Implementations§
Source§impl AsRef<Reference> for InputElement
impl AsRef<Reference> for InputElement
Source§impl Clone for InputElement
impl Clone for InputElement
Source§fn clone(&self) -> InputElement
fn clone(&self) -> InputElement
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for InputElement
impl Debug for InputElement
Source§impl From<InputElement> for Element
impl From<InputElement> for Element
Source§fn from(value: InputElement) -> Self
fn from(value: InputElement) -> Self
Source§impl From<InputElement> for EventTarget
impl From<InputElement> for EventTarget
Source§fn from(value: InputElement) -> Self
fn from(value: InputElement) -> Self
Source§impl From<InputElement> for HtmlElement
impl From<InputElement> for HtmlElement
Source§fn from(value: InputElement) -> Self
fn from(value: InputElement) -> Self
Source§impl From<InputElement> for Node
impl From<InputElement> for Node
Source§fn from(value: InputElement) -> Self
fn from(value: InputElement) -> Self
Source§impl From<InputElement> for Reference
impl From<InputElement> for Reference
Source§fn from(value: InputElement) -> Self
fn from(value: InputElement) -> Self
Source§impl IElement for InputElement
impl IElement for InputElement
Source§fn namespace_uri(&self) -> Option<String>
fn namespace_uri(&self) -> Option<String>
Source§fn class_list(&self) -> TokenList
fn class_list(&self) -> TokenList
Source§fn has_attribute(&self, name: &str) -> bool
fn has_attribute(&self, name: &str) -> bool
Source§fn get_attribute(&self, name: &str) -> Option<String>
fn get_attribute(&self, name: &str) -> Option<String>
Source§fn set_attribute(
&self,
name: &str,
value: &str,
) -> Result<(), InvalidCharacterError>
fn set_attribute( &self, name: &str, value: &str, ) -> Result<(), InvalidCharacterError>
Source§fn scroll_top(&self) -> f64
fn scroll_top(&self) -> f64
Source§fn set_scroll_top(&self, value: f64)
fn set_scroll_top(&self, value: f64)
Source§fn scroll_left(&self) -> f64
fn scroll_left(&self) -> f64
Source§fn set_scroll_left(&self, value: f64)
fn set_scroll_left(&self, value: f64)
Source§fn get_attribute_names(&self) -> Vec<String>
fn get_attribute_names(&self) -> Vec<String>
Source§fn remove_attribute(&self, name: &str)
fn remove_attribute(&self, name: &str)
Source§fn has_attributes(&self) -> bool
fn has_attributes(&self) -> bool
Source§fn closest(&self, selectors: &str) -> Result<Option<Element>, SyntaxError>
fn closest(&self, selectors: &str) -> Result<Option<Element>, SyntaxError>
None
. Read moreSource§fn set_pointer_capture(&self, pointer_id: i32) -> Result<(), InvalidPointerId>
fn set_pointer_capture(&self, pointer_id: i32) -> Result<(), InvalidPointerId>
Source§fn release_pointer_capture(
&self,
pointer_id: i32,
) -> Result<(), InvalidPointerId>
fn release_pointer_capture( &self, pointer_id: i32, ) -> Result<(), InvalidPointerId>
Source§fn has_pointer_capture(&self, pointer_id: i32) -> bool
fn has_pointer_capture(&self, pointer_id: i32) -> bool
Source§fn insert_adjacent_html(
&self,
position: InsertPosition,
html: &str,
) -> Result<(), InsertAdjacentError>
fn insert_adjacent_html( &self, position: InsertPosition, html: &str, ) -> Result<(), InsertAdjacentError>
Source§fn insert_html_before(&self, html: &str) -> Result<(), InsertAdjacentError>
fn insert_html_before(&self, html: &str) -> Result<(), InsertAdjacentError>
Source§fn prepend_html(&self, html: &str) -> Result<(), InsertAdjacentError>
fn prepend_html(&self, html: &str) -> Result<(), InsertAdjacentError>
Source§fn append_html(&self, html: &str) -> Result<(), InsertAdjacentError>
fn append_html(&self, html: &str) -> Result<(), InsertAdjacentError>
Source§fn insert_html_after(&self, html: &str) -> Result<(), InsertAdjacentError>
fn insert_html_after(&self, html: &str) -> Result<(), InsertAdjacentError>
Source§fn slot(&self) -> String
fn slot(&self) -> String
Source§fn attach_shadow(
&self,
mode: ShadowRootMode,
) -> Result<ShadowRoot, AttachShadowError>
fn attach_shadow( &self, mode: ShadowRootMode, ) -> Result<ShadowRoot, AttachShadowError>
ShadowRoot
.
It returns a shadow root if successfully attached or None
if the element cannot be attached. Read moreSource§fn shadow_root(&self) -> Option<ShadowRoot>
fn shadow_root(&self) -> Option<ShadowRoot>
None
. Read moreSource§impl IEventTarget for InputElement
impl IEventTarget for InputElement
Source§fn add_event_listener<T, F>(&self, listener: F) -> EventListenerHandlewhere
T: ConcreteEvent,
F: FnMut(T) + 'static,
fn add_event_listener<T, F>(&self, listener: F) -> EventListenerHandlewhere
T: ConcreteEvent,
F: FnMut(T) + 'static,
EventTarget
on which it’s called. Read moreSource§impl IHtmlElement for InputElement
impl IHtmlElement for InputElement
Source§fn dataset(&self) -> StringMap
fn dataset(&self) -> StringMap
Source§fn get_bounding_client_rect(&self) -> Rect
fn get_bounding_client_rect(&self) -> Rect
Source§fn offset_width(&self) -> i32
fn offset_width(&self) -> i32
Source§fn offset_height(&self) -> i32
fn offset_height(&self) -> i32
Source§fn inner_text(&self) -> String
fn inner_text(&self) -> String
Source§impl INode for InputElement
impl INode for InputElement
Source§fn append_child<T: INode>(&self, child: &T)
fn append_child<T: INode>(&self, child: &T)
Source§fn remove_child<T: INode>(&self, child: &T) -> Result<Node, NotFoundError>
fn remove_child<T: INode>(&self, child: &T) -> Result<Node, NotFoundError>
Source§fn clone_node(&self, kind: CloneKind) -> Result<Self, TODO>
fn clone_node(&self, kind: CloneKind) -> Result<Self, TODO>
Source§fn contains<T: INode>(&self, node: &T) -> bool
fn contains<T: INode>(&self, node: &T) -> bool
Source§fn insert_before<T: INode, U: INode>(
&self,
new_node: &T,
reference_node: &U,
) -> Result<Node, InsertNodeError>
fn insert_before<T: INode, U: INode>( &self, new_node: &T, reference_node: &U, ) -> Result<Node, InsertNodeError>
Source§fn replace_child<T: INode, U: INode>(
&self,
new_child: &T,
old_child: &U,
) -> Result<Node, InsertNodeError>
fn replace_child<T: INode, U: INode>( &self, new_child: &T, old_child: &U, ) -> Result<Node, InsertNodeError>
Source§fn parent_node(&self) -> Option<Node>
fn parent_node(&self) -> Option<Node>
Source§fn first_child(&self) -> Option<Node>
fn first_child(&self) -> Option<Node>
None
if the node is childless. Read moreSource§fn last_child(&self) -> Option<Node>
fn last_child(&self) -> Option<Node>
None
if the node is childless. Read moreSource§fn next_sibling(&self) -> Option<Node>
fn next_sibling(&self) -> Option<Node>
None
if there isn’t such a node. Read moreSource§fn owner_document(&self) -> Option<Document>
fn owner_document(&self) -> Option<Document>
Document
that this node belongs to. Read moreSource§fn parent_element(&self) -> Option<Element>
fn parent_element(&self) -> Option<Element>
Element
that is the parent of this node. Returns null
if the node
has no parent or the parent is not an Element
. Read moreSource§fn previous_sibling(&self) -> Option<Node>
fn previous_sibling(&self) -> Option<Node>
None
if there isn’t such a node. Read moreSource§fn text_content(&self) -> Option<String>
fn text_content(&self) -> Option<String>
Source§fn set_text_content(&self, text: &str)
fn set_text_content(&self, text: &str)
Source§fn child_nodes(&self) -> NodeList
fn child_nodes(&self) -> NodeList
Source§fn has_child_nodes(&self) -> bool
fn has_child_nodes(&self) -> bool
Source§fn is_default_namespace(&self, namespace: &str) -> bool
fn is_default_namespace(&self, namespace: &str) -> bool
Source§fn is_equal_node<T: INode>(&self, node: &T) -> bool
fn is_equal_node<T: INode>(&self, node: &T) -> bool
Source§fn is_same_node<T: INode>(&self, node: &T) -> bool
fn is_same_node<T: INode>(&self, node: &T) -> bool
Node
references are the same. Read more