Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions dom.go
Original file line number Diff line number Diff line change
Expand Up @@ -1524,6 +1524,7 @@ type Element interface {

Attributes() map[string]string
Class() *TokenList
Closest(string) Element
ID() string
SetID(string)
TagName() string
Expand All @@ -1535,6 +1536,7 @@ type Element interface {
GetElementsByTagNameNS(ns string, name string) []Element
HasAttribute(string) bool
HasAttributeNS(ns string, name string) bool
Matches(string) bool
QuerySelector(string) Element
QuerySelectorAll(string) []Element
RemoveAttribute(string)
Expand Down Expand Up @@ -1727,6 +1729,10 @@ func (e *BasicElement) SetClass(s string) {
e.Set("className", s)
}

func (e *BasicElement) Closest(s string) Element {
return wrapElement(e.Call("closest", s))
}

func (e *BasicElement) ID() string {
return e.Get("id").String()
}
Expand Down Expand Up @@ -1767,6 +1773,10 @@ func (e *BasicElement) HasAttributeNS(ns string, name string) bool {
return e.Call("hasAttributeNS", ns, name).Bool()
}

func (e *BasicElement) Matches(s string) bool {
return e.Call("matches", s).Bool()
}

func (e *BasicElement) QuerySelector(s string) Element {
return wrapElement(e.Call("querySelector", s))
}
Expand Down