How can I retrieve the padding set in CSS for a div with {padding:10% 10px 20% 10px;} using JavaScript, considering that window.getComputedStyle(myelement).getPropertyValue('padding'); returns different results?
In Firefox, it shows as "10% 10px 20% 10px"
Meanwhile, in Chromium, it displays as "59.8839px 10px 119.768px 2px"
Is there an alternative method to obtain this information so that the percentages are retrieved instead of the current pixel values?
var div = document.getElementsByTagName('div')[0];
console.log(window.getComputedStyle(div).getPropertyValue('padding'));