func (d *DOM) Value(o *js.Object) string {
	return o.Get("value").String()
}
Value returns the value of an object as a string.
package dom
import (
	"log"
	"github.com/gopherjs/gopherjs/js"
)
var (
	Doc = js.Global.Get("document")
)
type DOM struct {
	doc *js.Object
}
func New(doc *js.Object) *DOM {
	return &DOM{doc: doc}
}
func (d *DOM) RemoveChildren(p *js.Object) {
	for p.Call("hasChildNodes").Bool() {
		p.Call("removeChild", p.Get("firstChild"))
	}
}
func (d *DOM) NewElement(tag string) *js.Object {
	return d.doc.Call("createElement", tag)
}
func (d *DOM) NewText(text string) *js.Object {
	return d.doc.Call("createTextNode", text)
}
func (d *DOM) DoClick(o *js.Object) {
	o.Call("click")
}
func (d *DOM) OnClick(o *js.Object, callback func()) {
	o.Call("addEventListener", "click", callback)
}
func (d *DOM) DoDOMContentLoaded() {
	event := d.doc.Call("createEvent", "Event")
	event.Call("initEvent", "DOMContentLoaded", true, true)
	d.doc.Call("dispatchEvent", event)
}
func (d *DOM) OnDOMContentLoaded(callback func()) {
	d.doc.Call("addEventListener", "DOMContentLoaded", callback)
}