I want to get all data attribute of child elements in the form of an array.
I tried with
"data_array" : $('#rule-list').children().data('fruits')
<div class="fruit-list" id="fruit-list">
<span class="chips" title="Click to remove" data-fruit="apple,mango; pineapple, watermelon">every month for 5 times</span>
<span class="chips" title="Click to remove" data-fruit="banana,kiwi">every May and November for 5 times</span>
</div>
the expected output should be
data_array = [[apple,mango; pineapple, watermelon],[banana,kiwi]]