{% block scripts %}
<script>
console.log('hello world')
const modalBtns = [...document.getElementsByClassName('btn btn-link modal-button')]
modalBtns.forEach(modalBtn=> modalBtn.addEventListener("click", function(){
console.log(modalBtn)
}))
</script>
{% endblock %}
{% block content %}
<div class="h1">Quiz List</div>
<hr>
{% for obj in object_list %}
<button
class="btn btn-link modal-button"
data-pk='{{obj.pk}}'
data-quiz='{{obj.name}}'
data-questions='{{obj.number_of_questions}}'
data-difficulty='{{obj.difficulty}}'
data-time='{{obj.time}}'
data-pass='{{obj.required_score_to_pass}}'
data-bs-toggle="modal"
data-bs-target="#quizStartModal">{{obj.name}}</button><br>
{% endfor %}
{% endnlock %}
Not able to see the output in the console and the elements which are in the class 'modal-button' are also not inserting into the array of modalBtns