I'm trying to set a CSS property, that is specific to IE, via javascript. Something like the following
document.body.style.-ms-content-zooming = "zoom";
or
document.body.style.-ms-scroll-snap-x = "whatever"
But the css property doesn't get set the way shown above (I tried the first line for sure). How could I accomplish the above task, or setting any css starting with a dash ( - ) for that matter, using javascript ?
I do not have an Internet Explorer at hand but usually styles containing dashes are camelcased like:
document.body.style.msContentZooming = "zoom";
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.