title: jQuery selector of name attribute for different element types
body: <p>I have a table of rows.  In one of the columns, some rows have a span with static text, some rows have a select with values to choose from.  All elements in that one column have the same name attribute.  In my form submit, I iterate thru the rows and want to get the values for all columns.  I would prefer to have one jQuery selector statement to get the value from that element (span or select with name attribute of "materialValue").  How would I do that with jQuery?  Here follows the html snippet.</p>
  
  <pre><code>&lt;table&gt;
    &lt;tr&gt;&lt;td&gt;
        &lt;span id="materialValue1" name="materialValue&gt;ONE&lt;/span&gt;
    &lt;/td&gt;&lt;/tr&gt;
    &lt;tr&gt;&lt;td&gt;
        &lt;span id="materialValue2" name="materialValue&gt;TWO&lt;/span&gt;
    &lt;/td&gt;&lt;/tr&gt;
    &lt;tr&gt;&lt;td&gt;
        &lt;select id="materialValue3" name="materialValue&gt;
          &lt;option&gt;ONE&lt;/option&gt;
          &lt;option&gt;TWO&lt;/option&gt;
          &lt;option&gt;THREE&lt;/option&gt;
        &lt;/select&gt;
    &lt;/td&gt;&lt;/tr&gt;
    &lt;tr&gt;&lt;td&gt;
        &lt;select id="materialValue4" name="materialValue&gt;
          &lt;option&gt;ONE&lt;/option&gt;
          &lt;option&gt;TWO&lt;/option&gt;
          &lt;option&gt;THREE&lt;/option&gt;
        &lt;/select&gt;
    &lt;/td&gt;&lt;/tr&gt;
  &lt;/table&gt;
  </code></pre>
  
  <p>Edit: I'm used to specifying the element type then square brackets with the attribute name/value.  I'm not sure how to specify the jquery selector without the element type name.  e.g. <code>$('span[name="materialValue"]', this)</code>.  Is it legal to specify <code>$('[name="materialValue"]', this)</code>?  looks weird to me.</p>