how to get element type by name?
<p>is there any elegant way to get element type by name?</p>

<p>I can expect rendered form contains dropdowns, inputs, tables, divs with name like "answer[x]" where x represent some number.
I need element type to know how to handle it.
I can try to get object with :</p>

<pre><code>$('td[name=answer\\[1\\]]') 
$('div[name=answer\\[1\\]]')
$('input[name=answer\\[1\\]]')
</code></pre>

<p>and when <code>$('input[name=answer\\[x\\]]').length &gt; 0</code> then "great! its input!".
It just doesn't look like elegant way...</p>
