Home >Web Front-end >JS Tutorial >How Can I Retrieve a Data-id Attribute from a Clicked Item Using jQuery's Quicksand Plugin?
Question:
When utilizing jQuery's Quicksand plugin, how can I access the data-id attribute of a clicked item and pass it to another web service? Specifically, how do I retrieve the data-id value using the .on() method for dynamically bound click events on sorted elements?
Answer:
To obtain the data-id attribute value, you can employ the following approaches:
alert($(this).attr("data-id"));
alert($(this).data("id"));
Note:
The above is the detailed content of How Can I Retrieve a Data-id Attribute from a Clicked Item Using jQuery's Quicksand Plugin?. For more information, please follow other related articles on the PHP Chinese website!