Grab the ID of a DIV Tag and then add some CSS style to the DIV accordingly
<p>I am using jQuery to grab the ID of a DIV Tag and then add some CSS style to the DIV 
accordingly.<br>
I am new to jQuery, and I am not sure if this is a good way to do it:</p>

<p>JavaScript:</p>

<pre><code>$(".myClass").click(function(e){
    var whatid = $(this).attr('id');
    var whichDiv = "divName"+whatid;
    ("$(\"#"+whichDiv+"\")").addClass();
    }
</code></pre>

<p>HTML:</p>

<pre><code>&lt;div id="myTest1" class="myClass"&gt;
  Helloworld I am new to JQuery 1
&lt;/div&gt;
&lt;div id="myTest2" class="myClass"&gt;
  Helloworld I am new to JQuery 2
&lt;/div&gt;
</code></pre>

<p>Please advise.</p>

<hr>

<p>What if I changed the code in this way:<br/></p>

<p>JavaScript:</p>

<pre><code>$(".myClass").click(function(e){
    var whatid = $(this).attr('id');
    var whichDiv = "divName"+whatid;
    ("$(\"#"+whichDiv+"\")").addClass();
    }
</code></pre>

<p>HTML:</p>

<pre><code>&lt;div id="1" class="myClass"&gt;CLick here 1&lt;/div&gt;
&lt;div id="2" class="myClass"&gt;CLick here 2&lt;/div&gt;

&lt;div id="myTest1"&gt;
  Helloworld I am new to JQuery 1
&lt;/div&gt;
&lt;div id="myTest2"&gt;
  Helloworld I am new to JQuery 2
&lt;/div&gt;
</code></pre>
