Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

jquery data attribute

/* html */
<a data-number="123">link</a>

/* js */
$(this).attr("data-number") // returns string "123"

$(this).data("number") // returns number 123 (jQuery >= 1.4.3 only)
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #jquery #data #attribute
ADD COMMENT
Topic
Name
6+3 =