Access HTML5 data attribute with jQuery


/ Published in: jQuery
Save to your folder(s)

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


You need to login to view comments.