Horje
how to select data attribute in javascript using queryselectorAll Code Example
how to select data attribute in javascript using queryselectorAll
    <!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>
queryselectorall in javascript to get data attribute value
//javascript get html data attribute




Javascript

Related
check the doc name in javascript Code Example check the doc name in javascript Code Example
open google map with latitude and longitude javascript Code Example open google map with latitude and longitude javascript Code Example
Delay js function Code Example Delay js function Code Example
timer in java script Code Example timer in java script Code Example
regex find lines containing two strings Code Example regex find lines containing two strings Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
8