Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

jquery get data attribute value by class

//get the result as array
<option value="<?php echo $value['id']; ?>" data-count="5">
</option>

var data = $('.myclass').map(function() {
    return $(this).data('optionid');
}).get();
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #jquery #data #attribute #class
ADD COMMENT
Topic
Name
5+4 =