JSFiddle - React, Tailwind, and code Playground

HTML

<div data-name="joe"  ></div>

JavaScript

var div = $('div').first();


console.log([ // wrapped in an array for extra legibility
$( div ).data( 'name' ) ,  
$( div ).data( 'name' ).indexOf('"') ,  // does it have quotes in it?
   ] );