this is the code I have:
$('a').on('click', function(e) {
e.preventDefault();
});
but this stops every link from working, I need it to be specific to the link that have a class of the name : “prevent”
for example : <a class="prevent" href="#link"> </a><a href="#link1"> </a>
in this case I want #link1 to work normally and #link will trigger e.preventDefault();
any ideas please? thank you
You should read: http://api.jquery.com/category/selectors/