Javascript Alert dialog on href-link while delete

The simplest way to show alert while deleting your record using anchor tag is

  <a href="/userProfile/{{$userinfo->id}}/del" onclick="return confirm('Are you sure?')" class="user-delete"><i class="fa fa-trash" aria-hidden="true"></i> Delete</a>
Advertisements