How to check current tag element in javascript?
<p>I've a GridView with three rows like this</p>

<pre><code>&lt;tr&gt;
   &lt;th&gt;SlNo&lt;/th&gt;
&lt;/tr&gt;
&lt;tr&gt;
   &lt;td&gt;1&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
   &lt;td&gt;2&lt;/td&gt;
&lt;/tr&gt;
</code></pre>

<p>I've the following code to traverse through the rows</p>

<pre><code>var GridViewRow=GridView.getElementsByTagName('tr')
</code></pre>

<p>Here the row length is 3.</p>

<p>I travese through the <code>GridViewRow</code> using for loop .Here how will i get the tag name of the current element ie (<code>th or td</code>).</p>

<p>If the tagname is "<code>TH</code>" it should return and if it is "<code>TD</code>" it should take the value of TD.</p>
