Access HTML5 data attribute with jQuery


/ Published in: jQuery

obviously one can access HTML5's data attribute super easy in jQuery


Copy this code and paste it in your HTML
  1. <span data-sku="SKU123456">My Product</span>
  2.  
  3. $("span").data("sku");

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.