From 84bcac0ec9de59378ae0ed3d51213dbb73c7844c Mon Sep 17 00:00:00 2001 From: Jan Andrle Date: Tue, 19 Sep 2023 16:19:37 +0200 Subject: [PATCH] :bug: handle 'value' attribute in 'setDeleteAttr' (jsdom) --- jsdom.js | 1 + 1 file changed, 1 insertion(+) diff --git a/jsdom.js b/jsdom.js index 804209e..5c8d45e 100644 --- a/jsdom.js +++ b/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);