I have an admin that dynamically adds news to a page. I have two different different classes that gives different styles to the news. From the admin I can not add those classes. How do I do with javascript so that when the do that I have armed load them from my admin I add for example to the news one a class and two and three others and four the same as the one?
For example, look like this
<div class="clase-1">
<h2>Titulo</h2>
<p>Bajada</p>
</div>
<div class="clase-2">
<h2>Titulo</h2>
<p>Bajada</p>
</div>
<div class="clase-2">
<h2>Titulo</h2>
<p>Bajada</p>
</div>
<div class="clase-1">
<h2>Titulo</h2>
<p>Bajada</p>
</div>
The divs are in a container, and I know what classes to put because I have predefined them. What matters to me is that the first news div and 4 have the same class.