I'm currently trying to build a menu, and I would like to have a dynamic targeting based on which button I'm pressing.
so for instance, my jquery code looks like this
jQuery(function($) {
$("button").on("click", function() {
$('.nav-content').find('> .nav-links').addClass("hidden");
$('#students').removeClass("hidden");
});
});
but I was wondering if I could write something like
$('#'.'(this).attr(data-content)').addClass("hidden");
Here is a link to JSFiddle where the full contect of the code can be viewed