html5 创建自定义标签: data-xxx
例:
<a href="javascript:void(0)" name="delete" data-val="${user.uid}">删除</a>
获取自定义的属性:
通过DOM.dataset.xxx获取
例:
$("a[name='delete']").click(function () { var conf = confirm("是否删除?"); if(conf){ var uid = this.dataset.val; $.ajax({ url: "userlist", data: {"type":"delete","uid":uid}, type: "post", success: function (data) { if(data == "0000"){ var trid = "#tr_"+uid; $(trid).remove(); } } }) } })