This is a Django template iterating through records. Each record contains a div that JS function fills in. In order for JS to know what to do, it needs to get a variable from each for loop iteration and use it. I don't know exactly how to achieve that or if it's possible. Maybe a different approach is needed where ever record triggers a timer in a separate JS object instance, I don't know.
---------- html -----------------------
{% for match in upcoming_matches %}
...
<tr>
<td> Match title </td>
<td> Match time </td>
<td> Starts in: </td>
<tr>
<tr>
<td> {{ match.title }} </td>
<td> {{ match.start_time }} </td>
<td> <div id="matchCountdown"/></td>
<tr>
...
{% endfor %}
------------ JS ---------------------------
$(function () {
var start_date = {{ match.start_date }}; // Obviously I can't access vars from for loop, I could access upcoming_matches but not the ones from for loop
var matchDate = new Date(start_date.getTime()
$('#matchCountdown').countdown({until: matchDate});
});