The problem is, I am adding a div with some data attributes on ajax call. All content is surrounded in that div. I am using jQuery to set these attributes
<div class='x'>Some Content</div>
$('.x').data('title', 'some title');
When I try to get this via plain/vanilla js it doesn't return anything but with jQuery I get the set data
$('.x').data('title') // some title
document.querySelector('.x').getAttribute('data-title') // null
Please help in this regard