3
I have a site where the content creation is dynamic and the user can choose the color to be used in components, but, I need him to see the update in real time, then, I need the class to be changed with the necessary value and the added elements also gain that change.
I have a class in my CSS as follows:
<style type="text/css">
.color
{
background: red;
}
</style>
How to change the background
of that class dynamically so that all elements receive the new value of background
and the next elements to be created already come with this element?
Explain better what you are trying to do, because it is not clear.
– Paulo
I have a site where the content creation is dynamic and the user can choose the color to be used in components, but, I need him to see the update in real time, then, I need the class to be changed with the necessary value and the added elements also gain that change
– Caio Gomes
Caio, I edited my answer, see if this solution serves.
– Paulo
not from @Paulomaciel but Sergio’s is exactly what I needed :D
– Caio Gomes
I removed the solution that I had put in since it is not changing the future elements, but added a complement to Sergio’s reply.
– Paulo