HTML5 data-* attribute

user-pic
Vote 0 Votes

HTML5 data- 開頭是特殊屬性, data- 之後只能用小寫, 通常用來傳遞變數

例:
<button data-id='1234'>Click</botton>

jQuery 可以用 $(this).data("id")); 來取得 1234

About this Entry

This page contains a single entry by Pank published on October 13, 2017 12:58 PM.

Fiddler - HTTP/HTTPS Debugging Proxy was the previous entry in this blog.

Web to PDF/Image is the next entry in this blog.

Find recent content on the main index or look in the archives to find all content.

Monthly Archives