I was wondering what:
I have some links in my html file, and for most of them I need to write clicks in my functions so as not to go to the top of the page (which does e.preventDefault ()) ת I need to write this action except for the functions that they are on actually do.
I can write something like this:
$('a').click(function(){e.preventDefault()})
Will this work? or it will create conflicts with real functions if I write like:
$('a').click(function(){e.preventDefault()}); $('a#goingToDoSomething').click(function(){console.log('just did it')})
I ask because I want to improve my code, but was not sure that it was. thanks, Alon
source share