Invalid css property gets removed in inline style

hell_man_3

New Member
I have defined some inline-style in a element\[code\]<div id="box" style="-ms-grid-row:1; background-color: yellow;"></div>\[/code\]and then with javascript I want to set a style.\[code\]var box = document.getElementById('box');box.innerHTML += '<br>before: ' + box.getAttribute('style');box.style.height = '100px';box.innerHTML += '<br>after: ' + box.getAttribute('style');\[/code\]and the output becomes:\[code\]before: -ms-grid-row:1; background-color: yellow;after: background-color: yellow; height: 100px;\[/code\]Test http://jsfiddle.net/P7eBN/The browser removed -ms-grid-row property which I dont want it to do, because I am writing a plugin that reads inline-style with -ms-grid-row property so -ms-grid-row need to be preserved somehow. The same is it when using jQuery eg. \[code\]$(box).height(100)\[/code\]How can I in the best way allow users set height by style.height and still be able to read -ms-grid-row property afterwards somehow?
 
Back
Top