mirror of
https://github.com/jaandrle/deka-dom-el
synced 2024-11-21 15:39:36 +01:00
🐛 handle 'value' attribute in 'setDeleteAttr' (jsdom)
This commit is contained in:
parent
7196698b46
commit
84bcac0ec9
1
jsdom.js
1
jsdom.js
@ -3,6 +3,7 @@ import { prop_process } from './src/dom-common.js';
|
||||
const { setDeleteAttr }= prop_process;
|
||||
/** @param {HTMLElement} obj */
|
||||
prop_process.setDeleteAttr= function(obj, prop, value){
|
||||
if("value"===prop) return obj.setAttribute(prop, value);
|
||||
if("checked"!==prop) return setDeleteAttr(obj, prop, value);
|
||||
if(value) return obj.setAttribute(prop, "");
|
||||
obj.removeAttribute(prop);
|
||||
|
Loading…
Reference in New Issue
Block a user