I am looping in a javascript template like:
{% for movie in movies %}
{{movie.name}}
{% endfor %}
Is there anyway like I can call a javascript function that returns required DOM element like:
{% for movie in movies %}
<script>
function get_movie(name) {
return "<div> class='movie-title'>name</div>
}
get_movie({{movie.name}})
</script>
{% endfor %}
I just want to call a js function and have some check and return an element according to..