Jquery binds the click event sample code for the a tag

  • 2020-03-30 03:26:41
  • OfStack

$(document).ready(function() {
$("a[name='del']").click(function(){
Ext.Msg.confirm(' prompt ',' Are you sure you want to delete the notice? ',function(button,text){
if(button=='yes'){
window.location.href="/admin/note!delete.action?id=${id}";
}
});
});
$("a[class='del2']").click(function(){
Ext.Msg.confirm(' prompt ',' Are you sure you want to delete the notice? ',function(button,text){
if(button=='yes'){
window.location.href="/admin/note!delete.action?id=${id}";
}
});
});
});

<a name="del"> delete </a>
<a class="del2"> delete 2</a>

Related articles: