title: JQuery 1.7 $(this).attr('type') for select gives undefined instead of "select-one" - Why?
body: <p>I have an example I made with JQuery 1.4</p>
  
  <p>here is the html:</p>
  
  <pre><code>&lt;!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" 
   "http://www.w3.org/TR/html4/strict.dtd"&gt;
  &lt;html&gt;
    &lt;head&gt;
      &lt;title&gt;Formularseite&lt;/title&gt;
      &lt;link href="style3.css" rel="stylesheet" type="text/css" media="all" /&gt;
      &lt;script type="text/javascript" src="js/jquery-1.7.js" &gt;&lt;/script&gt;
      &lt;script type="text/javascript" src="js/meineScripts.js" &gt;&lt;/script&gt;
    &lt;/head&gt;
    &lt;body&gt;
  &lt;?php
  if (isset($_POST['senden']))
  {
  
  }
  else { ?&gt;
      &lt;form action="formular.php" method="POST" enctype="Multipart/Formdata"&gt; 
        &lt;fieldset&gt;
          &lt;legend&gt;Demo1 JQuery&lt;/legend&gt;
          &lt;label for="auswahl1"&gt;Auswahl treffen:&lt;/label&gt;
          &lt;input class="grouptrigger" type="checkbox" id="auswahl1" name="daten[0]" value="true"/&gt;
          &lt;br/&gt;
          &lt;div class="auswahl1 hide_on_start"&gt;
            &lt;label for="eineZeile"&gt;Text:&lt;/label&gt;
            &lt;input type="text" id="eineZeile" name="daten[1]" value=""/&gt;
          &lt;/div&gt;
          &lt;input class="grouptrigger" type="radio" id="auswahl2a" name="daten[2]" value="1" /&gt;
          &lt;label for="auswahl2a"&gt;Option 1&lt;/label&gt;
          &lt;input class="grouptrigger" type="radio" id="auswahl2b" name="daten[2]" value="2" /&gt;
          &lt;label for="auswahl2b"&gt;Option 2&lt;/label&gt;
          &lt;input class="grouptrigger" type="radio" id="auswahl2c" name="daten[2]" value="3" /&gt;
          &lt;label for="auswahl2c"&gt;Option 3&lt;/label&gt;
          &lt;div class="hide_on_start auswahl2a"&gt;
            &lt;label for="eineZeile2a"&gt;Text Opt1:&lt;/label&gt;
            &lt;input type="text" id="eineZeile2a" name="daten[3]" value=""/&gt;
          &lt;/div&gt;
          &lt;div class="hide_on_start auswahl2b"&gt;
            &lt;label for="eineZeile2b"&gt;Text Opt2:&lt;/label&gt;
            &lt;input type="text" id="eineZeile2b" name="daten[4]" value=""/&gt;
          &lt;/div&gt;
          &lt;div class="hide_on_start auswahl2c"&gt;
            &lt;label for="eineZeile2c"&gt;Text Opt3:&lt;/label&gt;
            &lt;input type="text" id="eineZeile2c" name="daten[5]" value=""/&gt;
          &lt;/div&gt;
          &lt;br/&gt;
          &lt;label for="auswahl3"&gt;Auswahl treffen:&lt;/label&gt;
          &lt;select name="daten[6]" id="auswahl3" class="grouptrigger"&gt;
            &lt;option value="0" &gt;Bitte wählen:&lt;/option&gt;
            &lt;option value="1" id="auswahl3a" &gt;Eintrag&lt;/option&gt;
            &lt;option value="2" id="auswahl3b" &gt;anderer Eintrag&lt;/option&gt;
            &lt;option value="3" id="auswahl3c" &gt;weiterer Eintrag&lt;/option&gt;
          &lt;/select&gt;
          &lt;div class="hide_on_start auswahl3a"&gt;
            &lt;label for="eineZeile3a"&gt;Text 1:&lt;/label&gt;
            &lt;input type="text" id="eineZeile3a" name="daten[7]" value=""/&gt;
          &lt;/div&gt;
          &lt;div class="hide_on_start auswahl3b"&gt;
            &lt;label for="eineZeile3b"&gt;Text 2:&lt;/label&gt;
            &lt;input type="text" id="eineZeile3b" name="daten[8]" value=""/&gt;
          &lt;/div&gt;
          &lt;div class="hide_on_start auswahl3c"&gt;
            &lt;label for="eineZeile3c"&gt;Text 3:&lt;/label&gt;
            &lt;input type="text" id="eineZeile3c" name=""/&gt;
          &lt;/div&gt;        
        &lt;/fieldset&gt;
        &lt;p class="font20px"&gt;&lt;input type="submit" name="senden" value="Abschicken"&gt;&lt;/p&gt;
      &lt;/form&gt;
  &lt;?php } ?&gt;
    &lt;/body&gt;&lt;/html&gt;
  </code></pre>
  
  <p>here is the js:</p>
  
  <pre><code>// Add RegExp Filter
  // From: http://james.padolsey.com/javascript/regex-selector-for-jquery/
  $.expr[':'].regex = function(elem, index, match) {
    var matchParams = match[3].split(','),
      validLabels = /^(data|css):/,
      attr = {
        method: matchParams[0].match(validLabels) ? 
              matchParams[0].split(':')[0] : 'attr',
        property: matchParams.shift().replace(validLabels,'')
      },
      regexFlags = 'ig',
      regex = new RegExp(matchParams.join('').replace(/^\s+|\s+$/g,''), regexFlags);
    return regex.test(jQuery(elem)[attr.method](attr.property));
  }
  
  $(document).ready(function() {
    $('body').addClass('js');
  
    // Toggeling groups
    $(".grouptrigger").change( function() 
    {
      var toCheck = ":not(:checked)";
      if ($(this).hasClass('inverse'))
        toCheck = ":checked";
      var hideGroup = "."+this.id;
      // for radio buttons
      alert (" "+$(this).attr('type')+' '+this.id);
      if ($(this).attr('type') == "radio")
      {
        var hideGroupParent=hideGroup.substr(0,hideGroup.length-1);
        try { $("div:regex(class, .*"+hideGroupParent+".*)").hide(0); } catch (err) {}
        if ($("#" + this.id).is(":checked")) 
          $(hideGroup).show(0);
      }
      // for select lists
      else if ($(this).attr('type') == "select-one")
      {
        var hideGroupParent=this.id;
        hideGroup = '.'+$('#' + this.id + ' :selected').attr('id');
        try { $("div:regex(class, .*"+hideGroupParent+".*)").hide(0); } catch (err) {}
        $(hideGroup).show(0);
      }
      else
      // for checkboxes
      {
        if ($("#" + this.id).is(toCheck)) 
          try { $(hideGroup).hide(100); } catch (err) {}
        else
          $(hideGroup).show(100);
      }
    });
    $(".grouptrigger").change();
  });
  </code></pre>
  
  <p>The problem with JQuery 1.7 is that </p>
  
  <pre><code>alert (" "+$(this).attr('type')+' '+this.id);
  </code></pre>
  
  <p>yields 'undefined' for the select instead of 'select-one' as was the case with JQuery 1.4. Is that a bug or is there another way of detecting the select element?</p>