Text gets the combined text contents of each element in the set of matched elements, including their descendants.
()
| 52 | // Text gets the combined text contents of each element in the set of matched |
| 53 | // elements, including their descendants. |
| 54 | func (s *Selection) Text() string { |
| 55 | var buf bytes.Buffer |
| 56 | |
| 57 | // Slightly optimized vs calling Each: no single selection object created |
| 58 | for _, n := range s.Nodes { |
| 59 | buf.WriteString(getNodeText(n)) |
| 60 | } |
| 61 | return buf.String() |
| 62 | } |
| 63 | |
| 64 | // Size is an alias for Length. |
| 65 | func (s *Selection) Size() int { |