Reputation: 191
I am trying to assign webkit styles to an element but can not get it to work. This is what I need to assign:
-webkit-box-shadow:inset 0px 0px 0px 10px #f00;
-moz-box-shadow:inset 0px 0px 0px 10px #f00;
box-shadow:inset 0px 0px 0px 10px #f00;
This is what I have tried:
document.getElementById("EL").style.webkitBoxShadowInset = '0px 0px 0px 10px #f00';
document.getElementById("EL").style.mozBoxShadowInset = '0px 0px 0px 10px #f00';
document.getElementById("EL").style.boxShadowInset = '0px 0px 0px 10px #f00';
Upvotes: 1
Views: 68
Reputation: 13157
You can optimise the result :
var el = document.getElementById("EL"),
bS = 'inset 0px 0px 0px 10px #f00';
el.style.WebkitBoxShadow = el.style.MozBoxShadow = el.style.boxShadow = bS;
Upvotes: 1
Reputation: 1
document.getElementById("EL").style.WebkitBoxShadow = 'inset 0px 0px 0px 10px #f00';
document.getElementById("EL").style.MozBoxShadow = 'inset 0px 0px 0px 10px #f00';
document.getElementById("EL").style.boxShadow = 'inset 0px 0px 0px 10px #f00';
note the capitalization of Webkit* and Moz* and the location of the word inset
Upvotes: 1