I've looked through some documentation, but I feel like there's an easier method to remove one item from an array without using an iteration loop.
Updated jsFiddle: http://jsfiddle.net/G97bt/6/ using not()
<button id="1">1</button>
<button id="2">2</button>
<button id="3">3</button>
<div id="1a">Test</div>
<div id="2a">Test</div>
<div id="3a">Test</div>
var $myList = $("#1a, #2a, #3a");
$("#1").on("click", function() {
$myList.fadeOut(); // I want to fade DIVs #2a + #3a, not ALL
$("#1a").fadeIn("slow");
});
$("#2").on("click", function() {
$myList.fadeOut(); // I want to fade DIVs #1a + #3a, not ALL
$("#2a").fadeIn("slow");
});
$("#3").on("click", function() {
$myList.fadeOut(); // I want to fade DIVs #1a + #2a, not ALL
$("#3a").fadeIn("slow");
});
This is how I'm envisioning it would function:
$myList.remove['#1a'].fadeOut();
.splice()? developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/….filteris your buddy