JSFiddle - React, Tailwind, and code Playground

HTML

<div id="test"></div>

JavaScript

/*
    jQuery 1.4.2 vs 1.4.3 -- data method extends now a days

    Default is set to 1.4.3, select 1.4.2 and click run
*/

var div = $('#test');

div.data ('foo', 'bar')
    
/*
    1.4.3 = bar
    1.4.2 = bar
*/
console.log (div.data ('foo'));
             
var obj = {a: 1, b: 2, c: 3};

div.data (obj);

/*
    1.4.3 = foo
    1.4.2 = undefined
*/
console.log (div.data ('foo'));