Function: dom-elements

dom-elements is a byte-compiled function defined in dom.el.gz.

Signature

(dom-elements DOM ATTRIBUTE MATCH)

Documentation

Find elements matching MATCH (a regexp) in ATTRIBUTE.

ATTRIBUTE would typically be class, id or the like.

Source Code

;; Defined in /usr/src/emacs/lisp/dom.el.gz
(defun dom-elements (dom attribute match)
  "Find elements matching MATCH (a regexp) in ATTRIBUTE.
ATTRIBUTE would typically be `class', `id' or the like."
  (let ((matches (cl-loop for child in (dom-children dom)
			  for matches = (and (not (stringp child))
					     (dom-elements child attribute
							   match))
			  when matches
			  append matches))
	(attr (dom-attr dom attribute)))
    (if (and attr
	     (string-match match attr))
	(cons dom matches)
      matches)))