Example #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}
}
Example #2
0
func addClick(selector css.Selector, handler func(dom.Event)) {
	document := dom.GetWindow().Document()
	document.QuerySelector(selector.Selector()).AddEventListener("click", true, handler)
}
Example #3
0
func getValue(selector css.Selector) string {
	return dom.GetWindow().Document().QuerySelector(selector.Selector()).Underlying().Get("value").String()
}
Example #4
0
func setValue(selector css.Selector, value string) {
	dom.GetWindow().Document().QuerySelector(selector.Selector()).Underlying().Set("value", value)
}
Example #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
}