title: How to display select box and set text then remove select box when cell is clicked
body: <p>I'm trying to make it so that whenever a cell in a table is clicked that belongs to a manager a select box appears in its place and populates with managers to choose from, once that selection is made the select box should be removed amd the selection should now appear in its place. </p>
  
  <p>I keep geeting an error</p>
  
  <p>Object doesn't support property or method 'each'</p>
  
  <p>Here is the code, other thatn the array this is it</p>
  
  <pre><code>$('td.managers').click(function() {
      var text = $(this).text();
      $(this).text('');
      $('&lt;select id="mgrslct" /&gt;').appendTo($(this)).val(text);
      managers.sort();
      for (var j = managers.length - 1; j &gt;= 0; j--) {
          $('&lt;option /&gt;').val(managers[j]).html(managers[j]).appendTo('#mgrslct');
      };
      $('#mgrslct').change(function(e) {
          var newText = $(this).val;
          $(this).parent().text(newText).find('#mgrslct').remove()
      })
  }) 
  </code></pre>