Skip to main content

new_html_element

Function new_html_element 

Source
pub fn new_html_element(tag_name: &str) -> NodeRef
Expand description

Create a new, detached HTML element node with the given tag name and no attributes or children.

ยงExamples

use readable_rs::{new_html_element, NodeExt};

let div = new_html_element("div");
assert_eq!(div.element_name(), Some("div"));