JQuery data is selected from several names
2 answers
To do this, use the base Attribute Selector . Thus, you can target this way:
$('[data-target="one"]');
And getting the data item can be done with:
$('[data-target="one"]').data("target");
Make sure you are using the latest version of jQuery. If not, you can also use pure JavaScript :
document.querySelectorAll('[data-target="one"]');
+3