title: get the id of the table row onclick
body: <p>Requirement is to get the value of the id on click on any of the table row data. </p>
  
  <p>Please find the fiddle : <a href="http://jsfiddle.net/T887t/55/" rel="nofollow">http://jsfiddle.net/T887t/55/</a></p>
  
  <p>Below is the javascript i tried:</p>
  
  <pre><code>&lt;script&gt;
      function test(){
        alert("test called");
        var serviceID = $(this).attr('id');
        alert("serviceID :: " + serviceID);
      }
  &lt;/script&gt;
  </code></pre>
  
  <p>html code:</p>
  
  <pre><code>&lt;table border="1"&gt;
    &lt;tr&gt;
      &lt;th&gt;&lt;b&gt; Column1 &lt;/b&gt; &lt;/th&gt;
      &lt;th&gt;&lt;b&gt; Column2 &lt;/b&gt; &lt;/th&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td class="navigateTest" id="88" onclick="test()"&gt; Row1 - Data1 &lt;/td&gt; 
      &lt;td class="navigateTest" id="98" onclick="test()"&gt; Row1 - Data2  &lt;/td&gt;    
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td class="navigateTest" id="33" onclick="test()"&gt; Row2 -  Data1  &lt;/td&gt; 
      &lt;td class="navigateTest" id="55" onclick="test()"&gt; Row2 - Data2  &lt;/td&gt;    
    &lt;/tr&gt;
  &lt;/table&gt;
  </code></pre>
  
  <p>Could not able to get the value of the id in javascript function. The value of the id is dynamic on my application. Please suggest.</p>