Code Snippet

Just another Code Snippet site

[JQuery] Custom attributes

Retrieve custom attribute value :

<li data-something="CommonLi"></li>
$("li").data("something") //"CommonLi"
<li attr1="something"></li>
$("li").attr("attr1") //"something"

,


Comments are currently closed.