Exemplo n.º 1
0
//QuerySelector equivaltent to javascripts querySelector
func (document Document) QuerySelector(selector css.Selector) Element {
	object := document.object.Call("querySelector", selector.Selector())
	return Element{object: object}
}
Exemplo n.º 2
0
func addClick(selector css.Selector, handler func(dom.Event)) {
	document := dom.GetWindow().Document()
	document.QuerySelector(selector.Selector()).AddEventListener("click", true, handler)
}
Exemplo n.º 3
0
func getValue(selector css.Selector) string {
	return dom.GetWindow().Document().QuerySelector(selector.Selector()).Underlying().Get("value").String()
}
Exemplo n.º 4
0
func setValue(selector css.Selector, value string) {
	dom.GetWindow().Document().QuerySelector(selector.Selector()).Underlying().Set("value", value)
}
Exemplo n.º 5
0
//JQuery allows calling JQuery functions on given css.Selector
func (document *Document) JQuery(selector css.Selector) (element jQuerySelector) {
	element.selector = selector.Selector()
	element.document = document
	return
}