Add CSS rule via jQuery for future created elements

This should work:

var style = $('<style>.class { background-color: blue; }</style>');
$('html > head').append(style);

Leave a Comment