package
0.0.0-20180612134603-5a689ece0d3e
Repository: https://github.com/mjkwoolnough/gopherjs.git
Documentation: pkg.go.dev

# README

xjs

-- import "github.com/MJKWoolnough/gopherjs/xjs"

Package xjs provides some simple, but often needed shortcut funcs for gopherJS

Usage

func Alert

func Alert(format string, params ...interface{})

Alert provides for formated alert boxes

func AppendChildren

func AppendChildren(parent dom.Node, children ...dom.Node) dom.Node

AppendChildren appends all the given children to the parent.

func Body

func Body() *dom.HTMLBodyElement

Body gets the document's body element

func CreateElement

func CreateElement(name string) dom.Element

CreateElement is a shortcut to create an element with the given name

func Log

func Log(format string, params ...interface{})

Log prints a formatted string to the javascript console

func RemoveChildren

func RemoveChildren(node dom.Node) dom.Node

RemoveChildren removes all of the child nodes of the node given

func SetInnerText

func SetInnerText(node dom.Node, text string) dom.Node

SetInnerText removes all child nodes from the given node and sets a single Text Node with the given string

func SetPreText

func SetPreText(node dom.Node, text string) dom.Node

SetPreText does similar to SetInnerText, but linebreaks are converted to
s

func Text

func Text(text string) *dom.Text

Text creates a text node containing the givin text

# Functions

Alert provides for formated alert boxes.
AppendChildren appends all the given children to the parent.
Body gets the document's body element.
CreateElement is a shortcut to create an element with the given name.
Log prints a formatted string to the javascript console.
RemoveChildren removes all of the child nodes of the node given.
SetInnerText removes all child nodes from the given node and sets a single Text Node with the given string.
SetPreText does similar to SetInnerText, but linebreaks are converted to <br />s.
Text creates a text node containing the givin text.