I have a code that allows to add style with class to head section:
$("<style type='text/css'> .redbold{ color:#f00; font-weight:bold;} </style>").appendTo("head");
If I call this code elsewhere, a new style section is created each time and it looks like this :
<style type="text/css"> .redbold{ color:#f00; font-weight:bold;} </style>
<style type="text/css"> .newclass{ color:black;} </style>
Is this possible to add a new class many times to the style section and do not create new ones each time? Thanks for help
idon the style block and then access it.<style id="mystyles">...</style>and then$('#mystyles').append(...)