Here is the function:
function lastmenuborder() {
var articleparent = document.getElementById('article').parentNode;
var articlestyle = window.getComputedStyle(articleparent,null).getPropertyValue('borderRadius');
alert (articlestyle);
}
I get no value, yet the css for the parent node is:
div#mainbody div.placeholder {
border-radius: 3px;
}
What would I have to change to return "3px"? All help greatly appreciated; I am still a newb at JavaScript.
For getPropertyValue()
, you use hyphens instead of camelCase.
This works in Chrome...
.getPropertyValue('border-radius');
But Firefox seems to require specific corners using this syntax...
.getPropertyValue('border-top-left-radius');
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With