I'm trying to show alert message before an action happens in js here is my code :
content+='<a href='+delete_url+' onclick="return confirm('Are you sure you want to delete this item?');\"><button class="w-11/12 text-xs text-center text-white mx-auto bg-purple-900 py-1 px-2 rounded-xl"><i class="far fa-images"></i></button></a>';
but it shows nothing , when i change to '""' it raise this error:
Uncaught SyntaxError: Unexpected token 'return'
thank you in advance ..