dom

package
v2.9.4 Latest Latest
Warning

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

Go to latest
Published: Aug 5, 2023 License: GPL-2.0 Imports: 2 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

Functions

func Walk

func Walk(nodetypes []NodeType, e js.Value, fn func(Node))

Types

type Document

type Document js.Value

func Parse

func Parse(html string) Document

func (Document) Body

func (d Document) Body() js.Value

func (Document) GetElementById

func (d Document) GetElementById(id string) js.Value

func (Document) Head

func (d Document) Head() js.Value

func (Document) MarshalJS added in v2.7.6

func (d Document) MarshalJS() js.Value

func (Document) QuerySelector

func (d Document) QuerySelector(query string) js.Value

func (Document) QuerySelectorAll

func (d Document) QuerySelectorAll(query string) []js.Value

func (Document) Walk

func (d Document) Walk(nodeTypes []NodeType, fn func(Node))

type Node added in v2.6.7

type Node struct {
	js.Value
	Depth int
}

func (Node) Call added in v2.6.7

func (d Node) Call(key string, args ...any) js.Value

func (Node) Children added in v2.6.7

func (d Node) Children() []Node

func (Node) FirstChild added in v2.6.7

func (d Node) FirstChild() Node

func (Node) Get added in v2.6.7

func (d Node) Get(key string) js.Value

func (Node) LastChild added in v2.6.7

func (d Node) LastChild() Node

func (Node) NextSibling added in v2.6.7

func (d Node) NextSibling() Node

func (Node) NodeName added in v2.6.7

func (d Node) NodeName() string

func (Node) NodeType added in v2.6.7

func (d Node) NodeType() NodeType

func (Node) Parent added in v2.6.7

func (d Node) Parent() Node

func (Node) PreviousSibling added in v2.6.7

func (d Node) PreviousSibling() Node

func (Node) Set added in v2.6.7

func (d Node) Set(key string, value any)

func (Node) Walk added in v2.6.7

func (d Node) Walk(nodeTypes []NodeType, fn func(Node))

type NodeType

type NodeType int
const (
	NodeTypeElement NodeType = iota + 1
	NodeTypeAttribute
	NodeTypeText
	NodeTypeCDATASection
	NodeTypeProcessingInstruction
	NodeTypeComment
	NodeTypeDocument
	NodeTypeDocumentType
	NodeTypeDocumentFragment
)

Jump to

Keyboard shortcuts

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