Documentation
¶
Rendered for js/wasm
Overview ¶
Package domini is minimalistiv package to access the web pages DOM from a go web app when using WebAssembly (wasm)
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Class ¶
type Class interface {
Underlyer
Add(classes ...string)
Remove(classes ...string)
Contains(class string) bool
}
Class represents the class list of an HTML element
type Document ¶
type Document interface {
Underlyer
EventTarget
EventSource
Queryer
GetElementByID(id string) HTMLElement
Body() HTMLElement
DocumentElement() HTMLElement
CreateElement(tag string) HTMLElement
CreateElementNS(ns, tag string) HTMLElement
}
Document represents the DOM root element
type Event ¶
type Event interface {
Underlyer
PreventDefault()
StopPropagation()
}
Event represents a DOM event
type EventSource ¶
type EventSource interface {
DispatchEvent(ev Event)
}
EventSource is implemented by all elements that dispatch events
type EventTarget ¶
type EventTarget interface {
AddEventListener(event string, useCapture bool, function func(Event)) js.Func
RemoveEventListener(event string, useCapture bool, cb js.Func)
}
EventTarget is implemented by all elements that receive events
type HTMLElement ¶
type HTMLElement interface {
Underlyer
EventTarget
EventSource
Queryer
ID() string
SetID(id string)
TagName() string
Class() Class
Style() Style
SetInnerHTML(html string)
InnerHTML() string
SetAttribute(attr, value string)
AppendChild(el HTMLElement)
RemoveChild(el HTMLElement)
ChildElements() []HTMLElement
ParentElement() HTMLElement
SetData(name, value string)
Data(name string) js.Value
}
HTMLElement represents an HTML element in a DOM
type Queryer ¶
type Queryer interface {
QuerySelector(query string) HTMLElement
QuerySelectorAll(query string) []HTMLElement
}
Queryer implements document querying functions
type Style ¶
type Style interface {
Underlyer
SetProperty(prop, value, prio string)
Property(prop string) string
RemoveProperty(prop string)
}
Style represents the CSS style declaration of an HTML element
type Underlyer ¶
Underlying is implemented by all DOM elements. It is used to access the underlying js.Value.
type Window ¶
type Window interface {
Underlyer
EventTarget
EventSource
Document() Document
}
Window represents the window
Click to show internal directories.
Click to hide internal directories.