diff --git a/fetch/main.go b/fetch/main.go index ad0e1a1..1b35f0d 100644 --- a/fetch/main.go +++ b/fetch/main.go @@ -16,7 +16,7 @@ type writer dom.Element // Write implements io.Writer. func (d writer) Write(p []byte) (n int, err error) { node := dom.GetDocument().CreateElement("div") - node.SetInnerHTML(string(p)) + node.SetTextContent(string(p)) (*dom.Element)(&d).AppendChild(node) return len(p), nil } diff --git a/html/test.wasm b/html/test.wasm index d8c419f..0ac3988 100755 Binary files a/html/test.wasm and b/html/test.wasm differ diff --git a/js/main.go b/js/main.go index ec7848e..e371fe4 100644 --- a/js/main.go +++ b/js/main.go @@ -14,7 +14,7 @@ func main() { div := document.Call("getElementById", "target") node := document.Call("createElement", "div") - node.Set("innerHTML", "Hello World") + node.Set("innerText", "Hello World") div.Call("appendChild", node) } diff --git a/jsgo/main.go b/jsgo/main.go index a443fdf..614ff10 100644 --- a/jsgo/main.go +++ b/jsgo/main.go @@ -14,7 +14,7 @@ func main() { div := document.Get("body") node := document.Call("createElement", "div") - node.Set("innerHTML", "Hello jsgo.io!") + node.Set("innerText", "Hello jsgo.io!") div.Call("appendChild", node) }