When using an inline editor to modify css classes, I encounter the need to remove and then re-add a class definition after making changes. Additionally, users have the option to delete elements, so it's important that the definition is also deleted.
Here is the code snippet for adding the class:
$("<style>").prop("type", "text/css").html( "#my_element_"+MaxElements+" {"+ xCSSCode +"}").appendTo("head");
However, removing this inserted class from the head of the page seems to be challenging, as shown below:
<style type="text/css">#my_element_1 {border-radius: 12.5px;
...
}</style>