可能重複:
Storing arbitrary info in HTML tags for JavaScript?
What are the concrete risks of using custom HTML attributes?
Custom attributes - Yay or nay?自定義屬性的HTML元素
什麼是一個標準的HTML元素添加自定義屬性的缺點?
例如:
< intput類型= 「文本框」 ID = 「身份識別碼」 MyCustomeAttribute = 「邁德特」/ >
通過添加MyCustomAttribute,我所做的文件無效,但什麼是實際implecations?這會導致什麼問題,如果有的話?
我會使用Javascript來讀取自定義屬性的值。
謝謝
Dupe:http://stackoverflow.com/questions/1600106/storing-arbitrary-info-in-html-tags-for-javascript – 2010-03-10 15:18:31