Utilizing handlebars as the view engine for node.js, the subsequent html content is dynamically produced and repeated: http://jsfiddle.net/4Q5PE/
<div class="btnsContainer">
<div class="btn-group" data-toggle="buttons">
<label class="btn btn1"><input type="checkbox" class="theBtn1">btn1</label>
<label class="btn btn2"><input type="checkbox" class="theBtn2">btn2</label>
<label class="btn btn3"><input type="checkbox" class="theBtn3">btn3</label>
</div>
</div>
<div class="Div1" style="display:none;">div1</div>
<div class="Div2" style="display:none;">div2</div>
<div class="Div3" style="display:none;">div3</div>
Furthermore, there's jQuery code to toggle elements, but all the matching repeated elements are displayed together:
$(document).on("change",".theBtn1",function () {
var $that = $(".Div1");
$that.slideToggle();
$(".btn2").removeClass("active");
$(".btn3").removeClass("active");
$(".Div1").not($that).slideUp();
$(".Div2").not($that).slideUp();
$(".Div3").not($that).slideUp();
});
...
I have experimented with various jQuery traversing methods like .parent, .children, .siblings, .next, and .previous, but what combination will effectively display only ONE element?