pub struct TextAreaElement(/* private fields */);
Expand description
The HTML <textarea>
element represents a multi-line plain-text editing control.
Implementations§
Trait Implementations§
Source§impl AsRef<Reference> for TextAreaElement
impl AsRef<Reference> for TextAreaElement
Source§impl Clone for TextAreaElement
impl Clone for TextAreaElement
Source§fn clone(&self) -> TextAreaElement
fn clone(&self) -> TextAreaElement
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for TextAreaElement
impl Debug for TextAreaElement
Source§impl From<TextAreaElement> for Element
impl From<TextAreaElement> for Element
Source§fn from(value: TextAreaElement) -> Self
fn from(value: TextAreaElement) -> Self
Converts to this type from the input type.
Source§impl From<TextAreaElement> for EventTarget
impl From<TextAreaElement> for EventTarget
Source§fn from(value: TextAreaElement) -> Self
fn from(value: TextAreaElement) -> Self
Converts to this type from the input type.
Source§impl From<TextAreaElement> for HtmlElement
impl From<TextAreaElement> for HtmlElement
Source§fn from(value: TextAreaElement) -> Self
fn from(value: TextAreaElement) -> Self
Converts to this type from the input type.
Source§impl From<TextAreaElement> for Node
impl From<TextAreaElement> for Node
Source§fn from(value: TextAreaElement) -> Self
fn from(value: TextAreaElement) -> Self
Converts to this type from the input type.
Source§impl From<TextAreaElement> for Reference
impl From<TextAreaElement> for Reference
Source§fn from(value: TextAreaElement) -> Self
fn from(value: TextAreaElement) -> Self
Converts to this type from the input type.
Source§impl IElement for TextAreaElement
impl IElement for TextAreaElement
Source§fn namespace_uri(&self) -> Option<String>
fn namespace_uri(&self) -> Option<String>
The Element.namespaceURI read-only property returns the namespace URI
of the element, or null if the element is not in a namespace. Read more
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
The Element.hasAttribute() method returns a Boolean value indicating whether
the specified element has the specified attribute or not. Read more
Source§fn get_attribute(&self, name: &str) -> Option<String>
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); Read more
Source§fn set_attribute(
&self,
name: &str,
value: &str,
) -> Result<(), InvalidCharacterError>
fn set_attribute( &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. Read more
Source§fn scroll_top(&self) -> f64
fn scroll_top(&self) -> f64
Gets the the number of pixels that an element’s content is scrolled vertically. Read more
Source§fn set_scroll_top(&self, value: f64)
fn set_scroll_top(&self, value: f64)
Sets the the number of pixels that an element’s content is scrolled vertically. Read more
Source§fn scroll_left(&self) -> f64
fn scroll_left(&self) -> f64
Gets the the number of pixels that an element’s content is scrolled to the left. Read more
Source§fn set_scroll_left(&self, value: f64)
fn set_scroll_left(&self, value: f64)
Sets the the number of pixels that an element’s content is scrolled to the left. Read more
Source§fn get_attribute_names(&self) -> Vec<String>
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. Read more
Source§fn remove_attribute(&self, name: &str)
fn remove_attribute(&self, name: &str)
Element.removeAttribute removes an attribute from the specified element. Read more
Source§fn has_attributes(&self) -> bool
fn has_attributes(&self) -> bool
The Element.hasAttributes() method returns Boolean value, indicating if
the current element has any attributes or not. Read more
Source§fn closest(&self, selectors: &str) -> Result<Option<Element>, SyntaxError>
fn closest(&self, selectors: &str) -> Result<Option<Element>, SyntaxError>
Returns the closest ancestor of the element (or the element itself) which matches the selectors
given in parameter. If there isn’t such an ancestor, it returns
None
. Read moreSource§fn set_pointer_capture(&self, pointer_id: i32) -> Result<(), InvalidPointerId>
fn set_pointer_capture(&self, pointer_id: i32) -> Result<(), InvalidPointerId>
Designates a specific element as the capture target of future pointer events. Read more
Source§fn release_pointer_capture(
&self,
pointer_id: i32,
) -> Result<(), InvalidPointerId>
fn release_pointer_capture( &self, pointer_id: i32, ) -> Result<(), InvalidPointerId>
Releases pointer capture that was previously set for a specific pointer Read more
Source§fn has_pointer_capture(&self, pointer_id: i32) -> bool
fn has_pointer_capture(&self, pointer_id: i32) -> bool
Returns a boolean indicating if the element has captured the specified pointer Read more
Source§fn insert_adjacent_html(
&self,
position: InsertPosition,
html: &str,
) -> Result<(), InsertAdjacentError>
fn insert_adjacent_html( &self, position: InsertPosition, html: &str, ) -> Result<(), InsertAdjacentError>
Insert nodes from HTML fragment into specified position. Read more
Source§fn insert_html_before(&self, html: &str) -> Result<(), InsertAdjacentError>
fn insert_html_before(&self, html: &str) -> Result<(), InsertAdjacentError>
Insert nodes from HTML fragment before element. Read more
Source§fn prepend_html(&self, html: &str) -> Result<(), InsertAdjacentError>
fn prepend_html(&self, html: &str) -> Result<(), InsertAdjacentError>
Insert nodes from HTML fragment as the first children of the element. Read more
Source§fn append_html(&self, html: &str) -> Result<(), InsertAdjacentError>
fn append_html(&self, html: &str) -> Result<(), InsertAdjacentError>
Insert nodes from HTML fragment as the last children of the element. Read more
Source§fn insert_html_after(&self, html: &str) -> Result<(), InsertAdjacentError>
fn insert_html_after(&self, html: &str) -> Result<(), InsertAdjacentError>
Insert nodes from HTML fragment after element. Read more
Source§fn slot(&self) -> String
fn slot(&self) -> String
The slot property of the Element interface returns the name of the shadow DOM
slot the element is inserted in. Read more
Source§fn attach_shadow(
&self,
mode: ShadowRootMode,
) -> Result<ShadowRoot, AttachShadowError>
fn attach_shadow( &self, mode: ShadowRootMode, ) -> Result<ShadowRoot, AttachShadowError>
Attach a shadow DOM tree to the specified element and returns a reference to its
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>
Returns the shadow root of the current element or
None
. Read moreSource§impl IEventTarget for TextAreaElement
impl IEventTarget for TextAreaElement
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,
Adds given event handler to the list of event listeners for
the specified
EventTarget
on which it’s called. Read moreSource§impl IHtmlElement for TextAreaElement
impl IHtmlElement for TextAreaElement
Source§fn dataset(&self) -> StringMap
fn dataset(&self) -> StringMap
Allows access, both in reading and writing, to all of the custom data attributes (data-*)
set on the element, either in HTML or in the DOM. Read more
Source§fn get_bounding_client_rect(&self) -> Rect
fn get_bounding_client_rect(&self) -> Rect
Returns the size of an element and its position relative to the viewport.
(JavaScript docs)
Source§fn offset_width(&self) -> i32
fn offset_width(&self) -> i32
Returns the layout width of an element. Typically, an element’s offsetWidth is a
measurement which includes the element borders, the element horizontal padding, the
element vertical scrollbar (if present, if rendered) and the element CSS width.
Source§fn offset_height(&self) -> i32
fn offset_height(&self) -> i32
Returns the height of the element including vertical padding and borders, as an
integer.
Source§fn inner_text(&self) -> String
fn inner_text(&self) -> String
A property which represents the “rendered” text content of a node and its descendants.
It approximates the text the user would get if they highlighted the contents of the element
with the cursor and then copied to the clipboard. Read more
Source§impl INode for TextAreaElement
impl INode for TextAreaElement
Source§fn append_child<T: INode>(&self, child: &T)
fn append_child<T: INode>(&self, child: &T)
Adds a node to the end of the list of children of a specified parent node. Read more
Source§fn remove_child<T: INode>(&self, child: &T) -> Result<Node, NotFoundError>
fn remove_child<T: INode>(&self, child: &T) -> Result<Node, NotFoundError>
Removes a child node from the DOM. Read more
Source§fn clone_node(&self, kind: CloneKind) -> Result<Self, TODO>
fn clone_node(&self, kind: CloneKind) -> Result<Self, TODO>
Returns a duplicate of the node on which this method was called. Read more
Source§fn contains<T: INode>(&self, node: &T) -> bool
fn contains<T: INode>(&self, node: &T) -> bool
Checks whenever a given node is a descendant of this one or not. Read more
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>
Inserts the specified node before the reference node as a child of the current node. Read more
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>
Replaces one hild node of the specified node with another. Read more
Source§fn parent_node(&self) -> Option<Node>
fn parent_node(&self) -> Option<Node>
Returns the parent of this node in the DOM tree. Read more
Source§fn first_child(&self) -> Option<Node>
fn first_child(&self) -> Option<Node>
Returns the node’s first child in the tree, or
None
if the node is childless. Read moreSource§fn last_child(&self) -> Option<Node>
fn last_child(&self) -> Option<Node>
Returns the node’s last child in the tree, or
None
if the node is childless. Read moreSource§fn next_sibling(&self) -> Option<Node>
fn next_sibling(&self) -> Option<Node>
Returns the node’s next sibling in the tree, or
None
if there isn’t such a node. Read moreSource§fn owner_document(&self) -> Option<Document>
fn owner_document(&self) -> Option<Document>
Returns the
Document
that this node belongs to. Read moreSource§fn parent_element(&self) -> Option<Element>
fn parent_element(&self) -> Option<Element>
Returns an
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>
Returns the node’s previous sibling in the tree, or
None
if there isn’t such a node. Read moreSource§fn text_content(&self) -> Option<String>
fn text_content(&self) -> Option<String>
A property which represents the text content of a node and its descendants. Read more
Source§fn set_text_content(&self, text: &str)
fn set_text_content(&self, text: &str)
Sets the text content of this node; calling thil removes all
of node’s children and replaces them with a single text node
with the given value. Read more
Source§fn child_nodes(&self) -> NodeList
fn child_nodes(&self) -> NodeList
Returns a live collection of child nodes of this node. Read more
Source§fn has_child_nodes(&self) -> bool
fn has_child_nodes(&self) -> bool
Returns whether this node has children nodes. Read more
Source§fn is_default_namespace(&self, namespace: &str) -> bool
fn is_default_namespace(&self, namespace: &str) -> bool
Determines whether the given namespace is the default namespace of this node. Read more
Source§fn is_equal_node<T: INode>(&self, node: &T) -> bool
fn is_equal_node<T: INode>(&self, node: &T) -> bool
Tests whether this node is equal to another node. Two nodes are equal if
they have the same type, defining characteristics, matching attributes,
and so on. Read more
Source§fn is_same_node<T: INode>(&self, node: &T) -> bool
fn is_same_node<T: INode>(&self, node: &T) -> bool
Test whether two
Node
references are the same. Read moreSource§fn lookup_prefix(&self, namespace: &str) -> Option<String>
fn lookup_prefix(&self, namespace: &str) -> Option<String>
Returns the prefix for the given namespace URI, if present. Read more
Source§impl InstanceOf for TextAreaElement
impl InstanceOf for TextAreaElement
Source§impl PartialEq for TextAreaElement
impl PartialEq for TextAreaElement
Source§impl ReferenceType for TextAreaElement
impl ReferenceType for TextAreaElement
Source§unsafe fn from_reference_unchecked(reference: Reference) -> Self
unsafe fn from_reference_unchecked(reference: Reference) -> Self
Converts a given reference into a concrete reference-like wrapper.
Doesn’t do any type checking; highly unsafe to use!
Source§impl<'_r> TryFrom<&'_r Reference> for TextAreaElement
impl<'_r> TryFrom<&'_r Reference> for TextAreaElement
Source§impl<'_r> TryFrom<&'_r Value> for TextAreaElement
impl<'_r> TryFrom<&'_r Value> for TextAreaElement
Source§impl TryFrom<Element> for TextAreaElement
impl TryFrom<Element> for TextAreaElement
Source§impl TryFrom<EventTarget> for TextAreaElement
impl TryFrom<EventTarget> for TextAreaElement
Source§impl TryFrom<HtmlElement> for TextAreaElement
impl TryFrom<HtmlElement> for TextAreaElement
Source§impl TryFrom<Node> for TextAreaElement
impl TryFrom<Node> for TextAreaElement
Source§impl TryFrom<Reference> for TextAreaElement
impl TryFrom<Reference> for TextAreaElement
Source§impl TryFrom<TextAreaElement> for Reference
impl TryFrom<TextAreaElement> for Reference
Source§impl TryFrom<Value> for TextAreaElement
impl TryFrom<Value> for TextAreaElement
impl Eq for TextAreaElement
impl JsSerialize for TextAreaElement
impl StructuralPartialEq for TextAreaElement
Auto Trait Implementations§
impl Freeze for TextAreaElement
impl RefUnwindSafe for TextAreaElement
impl Send for TextAreaElement
impl Sync for TextAreaElement
impl Unpin for TextAreaElement
impl UnwindSafe for TextAreaElement
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IChildNode for Twhere
T: IElement,
impl<T> IChildNode for Twhere
T: IElement,
Source§impl<T> IParentNode for Twhere
T: IElement,
impl<T> IParentNode for Twhere
T: IElement,
Source§fn query_selector(&self, selector: &str) -> Result<Option<Element>, SyntaxError>
fn query_selector(&self, selector: &str) -> Result<Option<Element>, SyntaxError>
Returns the first element that is a descendant of the element on which it is
invoked that matches the specified group of selectors. Read more