use web_sys::wasm_bindgen::JsCast;
pub fn document_body() -> web_sys::HtmlElement {
document().body().expect("HTML document missing body")
}
pub fn document() -> web_sys::Document {
let window = web_sys::window().expect("no global `window` exists");
window.document().expect("should have a document on window")
}
pub fn get_element_by_id(id: &str) -> web_sys::HtmlElement {
document()
.get_element_by_id(id)
.unwrap()
.dyn_into()
.unwrap()
}
pub fn input_event_target_value(event: &web_sys::Event) -> Option<String> {
event
.target()?
.dyn_into::<web_sys::HtmlInputElement>()
.ok()?
.value()
.into()
}