As you can see from the code below I am attempting to pop up “revealFootNote” when “note” is clicked. That works fine but I have 10 foot notes and when I click on any of them they all pop up. Each footnote has a unique ID of “one”, “two” … “ten” I need for only the relevant footnote to pop-up when that particular class is clicked. If I replace .note with #one it still works but it pops up #one for any class clicked.
$(document).ready(function(){
$(".note").click(function() {;
$(".footNote").toggleClass("revealFootNote");
});
$(".footNote").click(function() {;
$(this).toggleClass("revealFootNote");
});
});
Help! I am 2 days into learning jQuery.
Thank you,
Taliesin
So, the end result after all the help you guys gave me:
$(".note, .revealFootNote").click(function() {
if ($(this).hasClass('note')) {
$('#'+$(this).data('target')).toggleClass("revealFootNote");
} else {
$(this).hide();
}
});
$(".footNote").click(function() {;
$(this).toggleClass("revealFootNote");
});
HTML
jQuery