1

is it possible to style a -webkit css property with .style? or setAtrrtibute() is the way to go?

Dziban
  • 19
  • 3
  • Does this answer your question? [How to set the style -webkit-transform dynamically using JavaScript?](https://stackoverflow.com/questions/708895/how-to-set-the-style-webkit-transform-dynamically-using-javascript) – Wais Kamal Dec 23 '20 at 20:11

1 Answers1

2

There is a way of getting an object's or element's property with brackets: object["property"] works the same as object.property. In the string, there is allowed to have a dash at the start.

To set a '-webkit' style property, just use element.style["-webkit..."] = "a value".

Tom
  • 21
  • 1