MCPcopy
hub / github.com/PuerkitoBio/goquery / Remove

Method Remove

manipulation.go:227–235  ·  view source on GitHub ↗

Remove removes the set of matched elements from the document. It returns the same selection, now consisting of nodes not in the document.

()

Source from the content-addressed store, hash-verified

225// Remove removes the set of matched elements from the document.
226// It returns the same selection, now consisting of nodes not in the document.
227func (s *Selection) Remove() *Selection {
228 for _, n := range s.Nodes {
229 if n.Parent != nil {
230 n.Parent.RemoveChild(n)
231 }
232 }
233
234 return s
235}
236
237// RemoveFiltered removes from the current set of matched elements those that
238// match the selector filter. It returns the Selection of removed nodes.

Callers 8

ReplaceWithHtmlMethod · 0.95
ReplaceWithNodesMethod · 0.95
TestAfterWithRemovedFunction · 0.80
TestBeforeWithRemovedFunction · 0.80
TestRemoveFunction · 0.80
TestRemoveAllFunction · 0.80
TestRemoveRootFunction · 0.80
RemoveMatcherMethod · 0.80

Calls

no outgoing calls

Tested by 5

TestAfterWithRemovedFunction · 0.64
TestBeforeWithRemovedFunction · 0.64
TestRemoveFunction · 0.64
TestRemoveAllFunction · 0.64
TestRemoveRootFunction · 0.64