Simple selecter event not working
I have the following HTML:
- <div class="social">
- <div data-link="#" class="icon-fb"> </div>
- <div data-link="#" class="icon-twitter"></div>
- <div data-link="#" class="icon-linkedin"></div>
- <div data-link="#" class="icon-git"></div>
- <div data-link="#" class="icon-vimeo"></div>
- <div data-link="#" class="icon-youtube"></div>
- </div>
Trying to build a quick selector so I can attach events:
- jQuery( document ).ready(function() {
- jQuery(".social > div[data-link]").each( function(e) {
- jQuery(e).click( function(e) {
- alert(e);
- });
- });
- });
But this does not work. I am really proficient with Mootools but have had to switch to jQuery for a project.
Please advise, thanks