I have multiple buttons with the class .modif
, each with a different title attribute such as title="one"
. All these buttons are associated with boxes that share the class .box_slide
. However, I am trying to display only the box that also has the additional class .box_one
and hide the rest of the boxes while retaining their shared class .box_slide
.
The issue is that currently all the boxes are hidden when clicked. Can someone suggest a more effective approach to achieve this?
$('.modif').click(function (){
var title = $(this).attr('title');
$('.box_slide').hide();
$('.box_' + title).show();
});