I know how to use javascript arrays. But is there any way to get and set arrays from html data-attribute values ?
Look at this:
<div data-array="Apple, Banana, Jam, Strawberry, Peanut"></div>
Js Code:
<script> const fruits = [There will be the values or data from data-array attribute]; </script>
How can I do it using javascript or jquery ?