Skip to content

Commit 850efcd

Browse files
author
John P. rouillard
committed
refactor: use removeAttribute for onclick rather than seting to null
Per: https://developer.mozilla.org/en-US/docs/Web/API/Element/removeAttribute You should use removeAttribute() instead of setting the attribute value to null either directly or using setAttribute(). Many attributes will not behave as expected if you set them to null.
1 parent d93bed3 commit 850efcd

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

html/classhelper.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ class ClassHelper extends HTMLElement {
137137

138138
// Removing the helpurl click behavior
139139
this.helpurlScript = this.helpurl.getAttribute("onclick");
140-
this.helpurl.setAttribute("onclick", "");
140+
this.helpurl.removeAttribute("onclick", "");
141141
this.helpurl.addEventListener("click", this.preventDefault);
142142

143143
this.helpurlProps = ClassHelper.parseHelpUrlProps(this.helpurl);

0 commit comments

Comments
 (0)