I am trying to combine multiple click functions with toggle class into one that will affect multiple elements separately. As seen on image i want to change css of element on click only for one which is inside same parent element as button ignoring any other elements with same class.

HTML: 

&lt;div style="display: inline-block"&gt;    
    &lt;section class="container2"&gt;
       1
    &lt;/section&gt;
    &lt;section&gt;
        &lt;p&gt;&lt;button id="button"&gt;change&lt;/button&gt;&lt;/p&gt;
    &lt;/section&gt;
&lt;/div&gt;


CSS:

.background {
    background: red !important;
}
.container2 {
    background: black;
    width: 100px;
    height: 50px;
    color: white;
}


jQuery:

var removeClass = true;

$("#button").click(function () {
    $('.container2').toggleClass('background');
    removeClass = false;
});

$(".container2").click(function() {
    removeClass = false;
});

$("html").click(function () {
    if (removeClass) {
        $(".container2").removeClass('background');
    }
    removeClass = true;
});

http://jsfiddle.net/dkhhecf2/1/


I know i can write something like this 


  $("#one, #two, #three").click...


But is there any other way?

http://i.stack.imgur.com/wJhKu.png

Any help would be greatly appreciated.


Question: 1/4 to 1/8 jack problem
Answer: You can't just use an adapter to plug your guitar directly into your laptop -- the laptop's sound card is expecting either mic-level or line-level sound, whereas your guitar is a very high impedance signal coming in at a very low level (particularly if your pickups are passive).

It's possible that your adapter is just faulty, but it's far more likely that you will need a special interface to use with your guitar. There are countless options, but for the most basic setup you would just want to google USB guitar cable. They're pretty cheap.