IsFunction checks the current matched set of elements against a predicate and returns true if at least one of these elements matches.
(f func(int, *Selection) bool)
| 22 | // IsFunction checks the current matched set of elements against a predicate and |
| 23 | // returns true if at least one of these elements matches. |
| 24 | func (s *Selection) IsFunction(f func(int, *Selection) bool) bool { |
| 25 | for i, n := range s.Nodes { |
| 26 | if f(i, newSingleSelection(n, s.document)) { |
| 27 | return true |
| 28 | } |
| 29 | } |
| 30 | return false |
| 31 | } |
| 32 | |
| 33 | // IsSelection checks the current matched set of elements against a Selection object |
| 34 | // and returns true if at least one of these elements matches. |