I want 'div#Welcome a' and 'div#Familiarize a' to point to this JS code:
e.preventDefault();
var itemClicked = $(this);
var id = itemClicked.attr("id");
id = id.replace(/\D/g,'');
slider.goToSlide(id);
return false;
right now i have this:
$('div#Welcome a').click(function(e){
and this:
$('div#Familiarize a').click(function(e){
for the click to go to the specified code. I was wondering if there was a way that anything that i wanted to be linked with this could could be without having to make a new function every time. Is there an ID for certain tags that i can put on? Thank you in advance.
$('div#Welcome a, div#Familiarize a').click(function(e){...});slider.goToSlide(this.id.replace(/\D/g,'')). The first line isn't needed becausereturn false;handles it.