Add CSS rule via jQuery for future created elements March 26, 2023 by Tarik This should work: var style = $('<style>.class { background-color: blue; }</style>'); $('html > head').append(style);