Answers for "how to select element with data attribute"

0

how to select data attribute in javascript

const link = document.querySelector('[data-link="1"]');
Posted by: Guest on April-07-2021
0

how to select all div with data attribute

/*Jquery*/
/*SM: the syntax is pretty straightforward*/
console.log($("[data-my-custom-attribute]"));
Posted by: Guest on June-02-2021

Code answers related to "how to select element with data attribute"

Code answers related to "Javascript"

Browse Popular Code Answers by Language