diff --git a/src/lib.rs b/src/lib.rs index fde84f75..37f515db 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -316,6 +316,7 @@ pub mod web { /// A module containing HTML DOM elements. pub mod html_element { + pub use webapi::html_elements::ButtonElement; pub use webapi::html_elements::ImageElement; pub use webapi::html_elements::InputElement; pub use webapi::html_elements::TextAreaElement; @@ -324,6 +325,7 @@ pub mod web { pub use webapi::html_elements::OptionElement; pub use webapi::html_elements::TemplateElement; pub use webapi::html_elements::SlotElement; + } /// A module containing JavaScript DOM events. diff --git a/src/webapi/html_elements/button.rs b/src/webapi/html_elements/button.rs new file mode 100644 index 00000000..c32467e3 --- /dev/null +++ b/src/webapi/html_elements/button.rs @@ -0,0 +1,95 @@ +use webapi::element::{Element, IElement}; +use webapi::event_target::{EventTarget, IEventTarget}; +use webapi::html_element::{HtmlElement, IHtmlElement}; +use webapi::node::{INode, Node}; +use webcore::try_from::TryInto; +use webcore::value::Reference; + +/// The HTML `"#; + let button: ButtonElement = Node::from_html(html).unwrap().try_into().unwrap(); + let is_disabled = button.is_disabled(); + + assert_eq!(is_disabled, false); + } +} \ No newline at end of file diff --git a/src/webapi/html_elements/mod.rs b/src/webapi/html_elements/mod.rs index 99bf3965..142441e1 100644 --- a/src/webapi/html_elements/mod.rs +++ b/src/webapi/html_elements/mod.rs @@ -6,8 +6,10 @@ mod select; mod option; mod template; mod slot; +mod button; pub use self::canvas::CanvasElement; +pub use self::button::ButtonElement; pub use self::image::ImageElement; pub use self::input::InputElement; pub use self::textarea::TextAreaElement;