JSFiddle - React, Tailwind, and code Playground

HTML

<ol>
    <li>apples</li>
    <li>oranges</li>
    <li>plum</li>
</ol>

JavaScript

$(function() {
    $('li').eq(0).data('color', 'red');
    $('li').eq(1).data('color', 'orange');
    $('li').eq(2).data('color', 'purple');
    alert($('li').data('color'));
    // returns 'red' which is the first value, instead of a collection of values
});