Hello there ,
var s = "width:20px;height:25px;color:red;font-family:myfontfamily";
i have a string like this,now how can i change the values of width,height etc using javascript.there may be a \n
after or before the properties (width,height etc)..
Ex : i want to change width
to 50px
on s
.
so it will be
var s = "width:50px;height:25px;color:red;font-family:myfontfamily";
My another replated Question is here Regular Expression to get text from css but it not working exactly what i need.
Please help me.
Thank you.
Update : You can see the Result on my fiddle here : http://jsfiddle.net/jitheshkt/s2DJR/14/
document.getElementById('thing').style.width = '50px';
– Florian Margaine Nov 12 '11 at 9:39