Here is my code:
{% for post in post_list %}
<div class="mybox">
<div id="post">
<h1 ><a class = 'title_font' href="{% url 'blog:post_detail' pk=post.pk %}"><strong>{{ post.title }}</strong></a></h1>
<a href="{%url 'blog:post_detail' pk=post.pk %}">Comments :</a>
</div>
</div>
<script src='{% static 'js/blog.js' %}'></script>
{% endfor %}
In my blog.js
JavaScript file, when I assign mybox random colors, all the posts have the same random background-color
.
How can I get different colors for each .mybox
element?