I want to give a confirm to the screen before deleting the object, but the return statement is constantly being underlined.How can I fix that?
{% if notifications %}
{% for not in notifications %}
<li>
<figure><img src="{{not.object.image.url}}" alt=""></figure>
<small>{{not.object.category.name}}</small>
<h4>{{not.object.title}}</h4>
<p>{{not.message}}</p>
<!-- <p><a href="#0" class="btn_1 gray"><i class="fa fa-fw fa-eye"></i> View course</a></p> -->
<ul class="buttons">
<li><a onclick="return confirm('Are you sure?');" href="{% url 'deleteNotificationsAdmin' not.pk %}" class="btn_1 gray delete wishlist_close" >
<i class="fa fa-fw fa-times-circle-o"></i> Delete</a></li>
</ul>
</li>
{% endfor %}
{% endif %}
When I hover over it with the mouse it gives an error
A 'return' statement can only be used within a function body.