I’m trying to use a system like bootstrap, but using .data() method to attach a function to the dom for a specific element.
For instance if an element has:
<a href="#" data-toggle="dropbox">Click me</a>
Can I just jQuery to triggle a function to these elements?
var dropBox = $('a').data('toggle', 'dropbox');
When I console.log(dropBox) it returns all a on the page. I’m trying to make this work on buttons and ('a') elements I write this on for .on('click'... and log this and I get undefined.
or