JQuery实现,希望大佬指点,a标签为啥不能绑定事件
<script type="text/javascript">
$(function(){
$(".delete").click(function(){
if(confirm("确定要删除吗?")){
var id = $(".delete").attr("data");
$("#mainForm").attr("action","DeleteOneServlet?id="+id);
$("#mainForm").submit();
}
});
});
</script>
<a class="delete" data="${it.id}" }>删除</a>