i have some variable like this in JavaScript:
var classattrib = "box-shadow:inset 12px 222px 2px 2px rgba(1,2,111,11);";
target.style['boxShadow'] = classattrib;
or:
target.style['webkitBoxShadow'] = classattrib;
But it is not working
//html
<div id="target">hello</div>
What am I doing wrong?
Don't include the name of the property en the value, try like this:
var classattrib = "inset 12px 222px 2px 2px rgba(1,2,111,11)";
target.style.boxShadow = classattrib;
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