diff --git a/src/runtime/internal/dom.ts b/src/runtime/internal/dom.ts index 58a0d0729a1f..2a55e409a3e3 100644 --- a/src/runtime/internal/dom.ts +++ b/src/runtime/internal/dom.ts @@ -86,7 +86,7 @@ export function self(fn) { export function attr(node: Element, attribute: string, value?: string) { if (value == null) node.removeAttribute(attribute); - else node.setAttribute(attribute, value); + else if (node.getAttribute(attribute) !== value) node.setAttribute(attribute, value); } export function set_attributes(node: Element & ElementCSSInlineStyle, attributes: { [x: string]: string }) {