diff options
author | Lars Ingebrigtsen <larsi@gnus.org> | 2020-04-30 06:05:17 +0200 |
---|---|---|
committer | Lars Ingebrigtsen <larsi@gnus.org> | 2020-04-30 06:05:26 +0200 |
commit | 6c1b12e7d2ff38e313eae97bfd01746ecacdb02f (patch) | |
tree | 9df52d6f67c91d5107b6d2af3af8df952264733b /lisp/dom.el | |
parent | 0a982c077e7393d865622ff780906a0cb252348d (diff) | |
download | emacs-6c1b12e7d2ff38e313eae97bfd01746ecacdb02f.tar.gz |
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/dom.el')
-rw-r--r-- | lisp/dom.el | 6 |
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 @@ (setcdr old value) (setcar (cdr node) (nconc (cadr node) (list (cons attribute value))))))) +(defun dom-remove-attribute (node attribute) + "Remove ATTRIBUTE from NODE." + (setq node (dom-ensure-node node)) + (when-let ((old (assoc attribute (cadr node)))) + (setcar (cdr node) (delq old (cadr node))))) + (defmacro dom-attr (node attr) "Return the attribute ATTR from NODE. A typical attribute is `href'." |