JSFiddle - React, Tailwind, and code Playground
HTML
<div data-stuff="a.b.c"></div>
I want this to alert 'a'. It seems to alert '[' which suggest that jquery is not parsing it as an array. How is this possible? Am I going about this the best way. I want to pass this data from the serverside to this DOM element.
JavaScript
var stuff = $('div').attr('data-stuff').split('.');
alert(stuff[0]);