{% for person in teacher %}
<tr class="bg-gray-100 border-b">
<td class="px-6 py-4 whitespace-nowrap text-sm font-medium text-gray-900"></td>
<td class="p-0 py-4 whitespace-nowrap text-sm font-medium text-gray-900">
<img src="{{person.customuser.profile_pic.url}}" class="rounded-lg w-32"
alt="Avatar" />
</td>
<td class="text-sm text-gray-900 font-light px-6 py-4 whitespace-nowrap">
<p>{{person.customuser.first_name}} {{person.customuser.last_name}}</p>
</td>
<td class="text-sm text-gray-900 font-light px-4 py-4 whitespace-nowrap">
{% for item in person.subjects.all %}
<p>{{item.name}}</p>
{% endfor %}
</td>
<td class="text-sm text-gray-900 font-light px-4 py-4 whitespace-nowrap">
<div class="flex items-center justify-center">
<div id="btnView" class="inline-flex shadow-md hover:shadow-lg focus:shadow-lg"
role="group">
<button type="button"
class="rounded-l inline-block px-6 py-2.5 bg-[#4951bf] text-white font-medium text-xs leading-tight uppercase hover:bg-blue-700 focus:bg-blue-700 focus:outline-none focus:ring-0 active:bg-blue-800 transition duration-150 ease-in-out">Edit</button>
<button onclick='viewDetails()'
type="button"
class=" inline-block px-6 py-2.5 bg-[#4951bf] text-white font-medium text-xs leading-tight uppercase hover:bg-green-700 focus:bg-green-700 focus:outline-none focus:ring-0 active:bg-green-800 transition duration-150 ease-in-out">View</button>
<button type="button"
class=" rounded-r inline-block px-6 py-2.5 bg-[#4951bf] text-white font-medium text-xs leading-tight uppercase hover:bg-red-700 focus:bg-red-700 focus:outline-none focus:ring-0 active:bg-blue-800 transition duration-150 ease-in-out">Delete</button>
</div>
</div>
</td>
</tr>
{% endfor %}
I want to call a javascript function viewDetails({{person.id}}) inside onclick event when the user presses the button.I want the value {{person.id}} to be passed as an argument which is coming from the for loop in jinja tag. Is it possible?