dom

package
v0.0.0-...-f5de9ae Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 21, 2023 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Rendered for js/wasm

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Alert

func Alert(message string)

func Confirm

func Confirm(prompt string) bool

func QueueMicrotask

func QueueMicrotask(fn func())

func Reload

func Reload()

func SetTimeout

func SetTimeout(fn func(args []js.Value), delay time.Duration, args ...js.Value) int

Types

type Document

type Document struct {
	*Element
}

func GetDocument

func GetDocument() *Document

func (*Document) Body

func (d *Document) Body() *Element

func (*Document) CreateElement

func (d *Document) CreateElement(tag string) *Element

func (*Document) GetElementByID

func (d *Document) GetElementByID(id string) *Element

func (*Document) Head

func (d *Document) Head() *Element

type Element

type Element struct {
	// contains filtered or unexported fields
}

func Body

func Body() *Element
func Head() *Element

func New

func New(tag string) *Element

func NewFromJS

func NewFromJS(elem js.Value) *Element

func (*Element) AddClass

func (e *Element) AddClass(class string)

func (*Element) AddEventListener

func (e *Element) AddEventListener(name string, listener EventListener) js.Func

func (*Element) AppendChild

func (e *Element) AppendChild(child *Element)

func (*Element) Children

func (e *Element) Children() []*Element

func (*Element) FirstChild

func (e *Element) FirstChild() *Element

func (*Element) Focus

func (e *Element) Focus()

func (*Element) GetBoundingClientRect

func (e *Element) GetBoundingClientRect() *Rect

func (*Element) GetProperty

func (e *Element) GetProperty(property string) js.Value

func (*Element) InnerText

func (e *Element) InnerText() string

func (*Element) InsertBefore

func (e *Element) InsertBefore(newChild, referenceNode *Element)

func (*Element) JSValue

func (e *Element) JSValue() js.Value

func (*Element) QuerySelector

func (e *Element) QuerySelector(query string) *Element

func (*Element) QuerySelectorAll

func (e *Element) QuerySelectorAll(query string) []*Element

func (*Element) Remove

func (e *Element) Remove()

func (*Element) RemoveClass

func (e *Element) RemoveClass(class string)

func (*Element) RemoveEventListener

func (e *Element) RemoveEventListener(name string, listener js.Func)

func (*Element) SetAttribute

func (e *Element) SetAttribute(prop, value string)

func (*Element) SetInnerHTML

func (e *Element) SetInnerHTML(contents string)

func (*Element) SetInnerText

func (e *Element) SetInnerText(contents string)

func (*Element) SetProperty

func (e *Element) SetProperty(property string, value js.Value)

func (*Element) SetScrollTop

func (e *Element) SetScrollTop(pixels int)

func (*Element) SetStyle

func (e *Element) SetStyle(props map[string]interface{})

func (*Element) SetValue

func (e *Element) SetValue(value string)

func (*Element) ToggleClass

func (e *Element) ToggleClass(class string)

func (*Element) Value

func (e *Element) Value() string

type EventListener

type EventListener = func(event js.Value)

type Rect

type Rect struct {
	Left, Top, Right, Bottom float64
	Width, Height            float64
}

func ViewportRect

func ViewportRect() *Rect

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL