queryselector data attribute

JavaScript
document.querySelectorAll(`[data-name*="funnel-chart-percent"]`)data attribute in jquery 

For setting attribute data to the element
Html
<p id="assign">Assigning data attribute</p>
jquery
$("#assign").data("title","firstparagraph");

Output:
<p id="assign" data-title="firstparagraph">Assigning data attribute</p>

For getting attribute data from the element
Html
<p id="assign" data-title="firstparagraph">Assigning data attribute</p>
jquery
console.log($("#assign").data("title"));
console.log($("#assign").data());

Output:
firstparagraph
{ title: firstparagraph }    <!DOCTYPE html>
    <html>
        <head></head>
        <body>
            <p data-foo="0"></p>
            <h6 data-foo="1"></h6>
            <script>
                var a = document.querySelectorAll('[data-foo]');

                for (var i in a) if (a.hasOwnProperty(i)) {
                    alert(a[i].getAttribute('data-foo'));
                }
            </script>
        </body>
    </html>
//javascript get html data attribute
Source

Also in JavaScript: