Webru

Frequently used javascript functions for Rust and WebAssembly

webru is a binding for web-sys

This crate assumes that you will only use this crate inside browser. Not any other javascript runtime such as Node.js

Example

```rust

use wasmbindgen::closure::Closure; use wasmbindgen::JsCast; use websys::{Element, HtmlElement}; use weblog::consolelog; use webru::{alert, body, callback, createelement, getelementbyid, reload, set_timeout};

// javascript Window.alert() method alert("You are in danger!");

// getting the tag/element let body: HtmlElement = body();

// creating a

tag using javascript document.createElement() method // This function will return the newly created element/tag let h1: Element = create_element("h1");

// adding some attributes to

tag h1.setid("heading-1"); // html id property h1.setclassname("heading"); // html class property` h1.setinner_html("Welcome to my website");

// pushing the

tag into the DOM body.append_child(&h1);

// This closure will be called the