Hi there! I've created a function that is supposed to return a specific computed style from a given element. It seems to be working perfectly fine in all desktop browsers that I've tested, but unfortunately, it's not functioning properly in mobile Safari. When I log the result of the getComputedStyle call to the console, it shows as "[object CCStyleDeclaration]", which is good news. However, when I try to log the result of the getPropertyValue call, it just returns "null" instead of the correct style. Any suggestions or help would be greatly appreciated. Thank you!
Utils.getStyle = function(element, style){
var strValue = "";
if(document.defaultView && document.defaultView.getComputedStyle){
strValue = document.defaultView.getComputedStyle(element, "").getPropertyValue(style);
}else if(element.currentStyle){
style = style.replace(/\-(\w)/g, function (strMatch, p1){
return p1.toUpperCase();
});
strValue = element.currentStyle[style];
};
return strValue;
};