Reputation: 8223
How can I set the -moz-border-radius with pure JavaScript (no jQuery, no plugins etc)?
document.getElementById('id')
Upvotes: 12
Views: 48617
Reputation: 35830
var myElementStyle = document.getElementById('id').style;
myElementStyle.borderRadius = '1em'; // standard
myElementStyle.MozBorderRadius = '1em'; // Mozilla
myElementStyle.WebkitBorderRadius = '1em'; // WebKit
Upvotes: 26
Reputation: 116980
Try:
document.getElementById('id').style.borderRadius = '1em'; // w3c
document.getElementById('id').style.MozBorderRadius = '1em'; // mozilla
But why not do it in a stylesheet?
Upvotes: 29