While not changing an existing style element, this works as a cross-browser way to create a new one:
$( "<style>body { background: black; }</style>" ).appendTo( "head" )
By cascading, it’ll override existing styles, which should do the trick.
More Related Contents:
- How do I switch my CSS stylesheet using jQuery?
- How to change the element of another div by clicking and hovering on an element of a different div
- Hide/Show div on specific page with jquery
- CSS block doesn’t show click on a button
- how to force list items to go to differents rows?
- Issue with a design when content increase [closed]
- Dropdown Z-index not responding [closed]
- How to change color of SVG image using CSS (jQuery SVG image replacement)?
- Auto-size dynamic text to fill fixed size container
- Access the css “:after” selector with jQuery [duplicate]
- Downloading jQuery UI CSS from Google’s CDN
- Create a CSS rule / class with jQuery at runtime
- How do I get background image size in jQuery?
- Remove CSS from a Div using JQuery
- Correct way to animate box-shadow with jQuery
- jQuery: height()/width() and “display:none”
- How to find the highest z-index using jQuery
- Selecting only first-level elements in jquery
- Changing Body Font-Size based on Font-Family with jQuery
- Get the value of -webkit-transform of an element with jquery
- jQuery/CSS: line-height of “normal” == ?px
- How to hide/remove a DIV when empty
- Trying to make multiple background images cycle through a slideshow with CSS and JQUERY
- Leave menu bar fixed on top when scrolled [closed]
- jQuery CSS() for dynamically created elements
- CSS3 equivalent to jQuery slideUp and slideDown?
- How add spaces between Slick carousel item
- Fading elements in and out without changing the layout of the page
- Custom CSS to allow chrome textarea resize smaller than initial state?
- What is alternative to use after jQuery 1.9 removed .toggle(function,function)?