$("#btn1").click(function(){ $("div").data("greeting", "Hello World"); }); $("#btn2").click(function(){ alert($("div").data("greeting")); });
jQuery data()
原创木子的昼夜 ©著作权
文章标签 jQuery data 文章分类 jQuery 前端开发
©著作权归作者所有:来自51CTO博客作者木子的昼夜的原创作品,请联系作者获取转载授权,否则将追究法律责任
提问和评论都可以,用心的回复会被更多人看到
评论
发布评论
相关文章
-
-_-#【jQuery】data
.data()
jquery html 数据 存储数据 数据存储