In my HTML I have a div
:
<div id="devicelayout">
Some text here
</div>
and corresponding CSS:
#devicelayout
{
width:1078px;
}
Once my page is loaded, how do I change the rules of CSS #devicelayout
?
If you just want to change css styles of the element you can directly assign a different class to it or change css properties of the element using JQuery using
$("#devicelayout").css("property", "value")
or
$("#devicelayout").addClass("newClass")
Or if you want to change css rules then try modifying stylesheet rules at document.styleSheets
object. See here
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With