Reputation: 9855
I have a tabbed content box that when a tab is clicked, a '#div1' is appended to the end of my URL. Is there a way of preventing jQuery from doing this?
I still can't get it to work. I've made a fiddle...
Upvotes: 6
Views: 7042
Reputation: 4235
easy
$(function(){
$('a[href="#"]').click(function(event){
event.preventDefault();
});
});
Upvotes: 3
Reputation: 9811
Sure, event.preventDefault()
is what you are looking for.
http://api.jquery.com/event.preventDefault/
Upvotes: 13