aboutsummaryrefslogtreecommitdiffstats
path: root/lisp
diff options
context:
space:
mode:
authorLars Ingebrigtsen2020-04-30 06:05:17 +0200
committerLars Ingebrigtsen2020-04-30 06:05:26 +0200
commit6c1b12e7d2ff38e313eae97bfd01746ecacdb02f (patch)
tree9df52d6f67c91d5107b6d2af3af8df952264733b /lisp
parent0a982c077e7393d865622ff780906a0cb252348d (diff)
downloademacs-6c1b12e7d2ff38e313eae97bfd01746ecacdb02f.tar.gz
emacs-6c1b12e7d2ff38e313eae97bfd01746ecacdb02f.zip
Add new function dom-remove-attribute
* doc/lispref/text.texi (Document Object Model): Document it. * lisp/dom.el (dom-remove-attribute): Add new function.
Diffstat (limited to 'lisp')
-rw-r--r--lisp/dom.el6
1 files changed, 6 insertions, 0 deletions
diff --git a/lisp/dom.el b/lisp/dom.el
index 34df0e9af4c..7ff9e07b729 100644
--- a/lisp/dom.el
+++ b/lisp/dom.el
@@ -67,6 +67,12 @@
67 (setcdr old value) 67 (setcdr old value)
68 (setcar (cdr node) (nconc (cadr node) (list (cons attribute value))))))) 68 (setcar (cdr node) (nconc (cadr node) (list (cons attribute value)))))))
69 69
70(defun dom-remove-attribute (node attribute)
71 "Remove ATTRIBUTE from NODE."
72 (setq node (dom-ensure-node node))
73 (when-let ((old (assoc attribute (cadr node))))
74 (setcar (cdr node) (delq old (cadr node)))))
75
70(defmacro dom-attr (node attr) 76(defmacro dom-attr (node attr)
71 "Return the attribute ATTR from NODE. 77 "Return the attribute ATTR from NODE.
72A typical attribute is `href'." 78A typical attribute is `href'."