mirror of
https://github.com/speice-io/isomorphic-rust
synced 2024-11-23 00:18:21 -05:00
19 lines
401 B
Rust
19 lines
401 B
Rust
|
#![feature(custom_attribute)]
|
||
|
|
||
|
extern crate stdweb;
|
||
|
extern crate wasm_bindgen;
|
||
|
|
||
|
use wasm_bindgen::prelude::*;
|
||
|
|
||
|
use stdweb::web::document;
|
||
|
use stdweb::web::INode;
|
||
|
use stdweb::web::IElement;
|
||
|
|
||
|
#[wasm_bindgen]
|
||
|
pub fn run() {
|
||
|
let doc = document();
|
||
|
let val = doc.create_element("p").unwrap();
|
||
|
val.set_attribute("innerHTML", "IT IS ALIVE").unwrap();
|
||
|
doc.body().unwrap().append_child(&val);
|
||
|
}
|