Welcome to MLink Developer Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
263 views
in Technique[技术] by (71.8m points)

Set style of -webkit using pure JavaScript using element.style.(?) = "stuff"

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


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

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".


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to MLink Developer Q&A Community for programmer and developer-Open, Learning and Share
...