Javascript eval
<p>I am trying to get the following working. It seemed to work initially, but somehow it stopped working</p>

<pre><code>var setCommonAttr = "1_row1_common";
var val = document.getElementById("abc_" + eval("setCommonAttr")).value;
</code></pre>

<p>what is wrong with above?</p>

<p>The above code is little different from what I am trying to accomplish. I gave the above example just not to make things complicated here. Below is what I am trying to accomplish:</p>

<p>First I am getting an existing element as follows. The element is a </p>

<pre><code>&lt;tr id="row_1_4_2009_abc" class="rowclick"&gt;
   &lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
</code></pre>

<p>I am using jquery to get the id on click of a row:</p>

<pre><code>$(".rowclick").click(function() {
  var row_id = $(this).attr("id");
  var getAttributes = row_id.split("_");
  var setCommonAttr = getAttributes[1] + "_" + getAttributes[2] + "_" + getAttributes[3] + "_" + getAttributes[4];
  var new_row_id = document.getElementById("new_row_" + setCommonAttr).value;
});
</code></pre>
