Custom Data Attributes HTML JavaScript CSS Tutorial




Source: http://www.developphp.com/video/JavaScript/Custom-Data-Attributes-HTML-JavaScript-CSS-Tutorial
Learn to use custom data attributes. Custom data attributes allow authors to create custom data to apply to their HTML elements when no other attributes make sense to use to store extra data. They help extend the information that html elements can communicate to a program or script. Custom data attributes can be accessed through both JavaScript and CSS.

Original source


26 responses to “Custom Data Attributes HTML JavaScript CSS Tutorial”

  1. Wow, that's sweet. I never never thought of using data-* for animation. Thanks, Adam.

    I wonder what processing power cost is like on those animations. I'll have to google it and find out how to measure it.

  2. Just for inspiration to the viewers: Another good use of the data-attribute that I tend use very often is in a table that is fed off a database. If you attach for example data-id to the table row tag you can access the id of the mysql-entry – which is very helpful if you want to place a edit or delete button which then affects only a certain row within the table… Nice video again. Sir Adam… 🙂

Leave a Reply