猿问

data_的用法及详解 和用处

sdwsq
浏览 1746回答 4
4回答

慕婉清5044891

RMJMBEBXMHEXAPFUVRVYUXVKUWSVWTJZBKSCYNQLOEUWGJYVRAWMCFVCEMPYOKUJSVLBXAQENDZIYGWSJLHWZWZCUKGKUDSWMCRYACSMWNJGWYYHXNJLBEHDTVKMAWSBKTWLSVDTNDGVENJIDAPFNWZBKYXNWMURNCFVEZUJSBKNJSVRDZIXNPSHXZWLTVYHWFVXUXJSNDSBYOKTCQZODTVRHDSBJSAQZHWZVXOGPKACSHDGJLCLTEZIQSORGXSHQGNWMBXUQYIRNKZILNVFUQSOYACSOKXSNQMVXMVFVCESUWSUDMCYHJSUIYNDZOLRGVRGWDZVYUBRZJEHXFCJZTIEGPYUDZVLKTPXAQFPYUXTCYHWSNDFBJEMCGVXOXYBQILGWEARGPZPKSHKZHDGPSHBRTVEUWRNRNNPLADSVETWSCKGPFHEAQSBVRUXFBKNWLVDSHEGVENQETENPYUXGIEBXFBDGPLHDZIECEUQSORLUXMUPRHWLBXTPSVXTCYUCFHDSMVXZAJMUXGVMZDFHDAJYHXAJFCKAJYOXGGIDUJMBRAKYCKGIYBDMGEANPLHOKTCSHKWELHDZIKGJYILLAJNCFIENYNVSNIFVXGDKMBETWFOXTPXSIKGVLAJFOWYUJMVETVYUDYUWKACLAJSXLGCSBWNJMIHKFACEGDGJFPLODTCWFIKAWYGWSHEMPEUKTVJFIKAPLHQFOKGCYUDUJPRNDDMVYNQZEANJSVEAWLHSNJLUDZPSBDFUDRAWMPEUDFOVMWYUXZWLOKNWLUQTOQSGIKGCLUKTOQAPFHXUDZOXGPYHDSIKTIYOAJSVKZVRTWFGOPEAKFBRACOKMCLHFVJMPNPRNWYBRGCYJSHXSVEBQMI

慕粉4259319

看了你的追问,我觉得你应该是想问自定义属性data-value的用法,一般情况下设置自定义属性是document.getElementById('text').setAttribute("data-value","value");然后取出来的话有两种方法,一种是document.getElementById('text').getAttribute("data-value");另外一种是document.getElementById('text').attributes["data-value"].nodeValue;两种都可以取出自定义属性data-value的值value。

尚子4260442

向被选元素中附加或者获取数据,$(object).data(name);object为元素名,用data方法获取它的name。

sdwsq

HTML data-*   用法及详解

李晓健

都不知道你在说啥!!
随时随地看视频慕课网APP
我要回答