标签:Jquery jquery 常用 document Js user js data id
1.获取data-*属性
document.getElementById('id').getAttribute("data-user")//js $('#id').data("user");//jquery
2.设置data-*属性
document.getElementById('id').setAttribute("data-user","张三")//js $('#id').data("user", "张三");//jquery
3.延迟执行
//参数1 函数,参数2延迟5秒执行 setTimeout(() => {},1000 * 5)
标签:Jquery,jquery,常用,document,Js,user,js,data,id 来源: https://www.cnblogs.com/zspwf/p/16292571.html