code: function setAttribute(element, attribute, value) {
          if (element.getAttribute(attribute) !== "" + value) {
              element.setAttribute(attribute, value);
          }
      }
docs: Only set the attribute if its value has changed