mirror of
https://github.com/PuerkitoBio/goquery
synced 2025-10-05 08:46:53 +08:00
15 lines
594 B
Go
15 lines
594 B
Go
package goquery
|
|
|
|
// Adds matching nodes to the current selection. Returns the same Selection object.
|
|
// The new selector string is run in the context of the document of the Selection object.
|
|
func (this *Selection) Add(selector string) *Selection {
|
|
this.Nodes = append(this.Nodes, findWithContext(selector, this.document.Root)...)
|
|
return this
|
|
}
|
|
|
|
// Adds nodes of the specified Selection object to the current selection. Returns this (the same Selection object).
|
|
func (this *Selection) AddFromSelection(sel *Selection) *Selection {
|
|
this.Nodes = append(this.Nodes, sel.Nodes...)
|
|
return this
|
|
}
|