Answers for "need to get data from table jquery"

2

jquery select element with data

$('[data-attribute="value"]');
Posted by: Guest on April-01-2020
0

jquery get data-*

// Fetching data
var fruitCount = $(this).data('fruit');
OR 
// If you updated the value, you will need to use below code to fetch new value 
// otherwise above gives the old value which is intially set.
// And also above does not work in ***Firefox***, so use below code to fetch value
var fruitCount = $(this).attr('data-fruit');

// Assigning data
$(this).attr('data-fruit','7');
Posted by: Guest on October-19-2021

Code answers related to "need to get data from table jquery"

Code answers related to "Javascript"

Browse Popular Code Answers by Language