I want to delete a row from my table. The deletion will be held by click an anchor tag and it will submit the delete form. But before submitting the form it will show a confirm dialog box.
<tr>
<td>
<a href="javascript:void(0)" onclick="$(this).parent().find('form').submit().confirm("Are you sure?")">Delete</a>
<form action="{{route('area.destroy',$row->id)}}" method="post">
@method('DELETE')
{{csrf_field()}}
</form>
</td>
</tr>
How can I write the JS/jQuery code? Also, if I want to use sweet alert how can I do that?