jQuery uses toLowerCase with attribute names, so it ends up as gradienttransform
not gradientTransform
, which is a new attribute and not the same as the one you already have, hence the issues.
The attr()
method starts like this
function (elem, name, value) {
var hooks, ret, nType = elem.nodeType;
// don't get/set attributes on text, comment and attribute nodes
if (!elem || nType === 3 || nType === 8 || nType === 2) {
return;
}
// Fallback to prop when attributes are not supported
if (typeof elem.getAttribute === core_strundefined) {
return jQuery.prop(elem, name, value);
}
// All attributes are lowercase
// Grab necessary hook if one is defined
if (nType !== 1 || !jQuery.isXMLDoc(elem)) {
name = name.toLowerCase(); // this is the line where the name is lowercased
hooks = jQuery.attrHooks[name] || (jQuery.expr.match.bool.test(name) ? boolHook : nodeHook);
}
if (value !== undefined) {
The way around this is to use setAttribute instead.