title: Accessing a select HTML Element from a JavaScript object
body: <p>I have a <code>JavaScript object</code> that returns <code>HTML information</code> to populate a responsive web application.  I am having an issue accessing a select box with a class to identify it and grab the selected option it contains.</p>
  
  <p><strong>Here is what I am doing:</strong> </p>
  
  <pre><code>var EditRowRestriction = OptionRules.prototype.getEditRowRestriction(j); &lt;!-- THIS IS THE OBJECT THAT CALLS A METHOD TO POPULATE HTML ELEMENTS TO BE SENT BACK TO THAN BE USED TO POPULATE SCREEN
  var check = $(EditRowRestriction).find("select");
  
  console.log(check);
  </code></pre>
  
  <p>Here is an example of what <code>check</code> would respond with:</p>
  
  <pre><code>select.restirction-select &lt;!-- THIS IS WHAT I WANT
  context: tr
  length: 1
  prevObject: v.fn.v.init[1]
  selector: "select"
  __proto__: Object[0]
  </code></pre>
  
  <p>Now that I am able to log that, if I try doing something like, <code>check[0].find(':selected').text();</code></p>
  
  <p>It would respond with an error: <code>Uncaught TypeError: undefined is not a function</code></p>
  
  <p>Now if I just output the <code>check[0]</code> I get this: <code>&lt;select&gt;&lt;/select&gt;</code>.</p>
  
  <p>Any suggestions?    </p>
  
  <p>UPDATE:</p>
  
  <p>Here is an example of how <code>select</code> is being populated</p>
  
  <pre><code>var sel = document.createElement("select");
  
      $.ajax({
          url: "actions/....php",
          type: "post",
          dataType: "json",
          data:
          {
              'function' : "admin_populate_global",
              'elevation_name' : '',
              'user' : $("li.selected").text()
          },
          success: function(data){
  
              // FIRST MAKE SURE DATA WAS FOUND
              if(data["status"] == "found")
              {
                      var restrictionArray = data["data_retrieved"].split(',');
                          var events = $(".option-rule-item").map(function() {
                              if($(this).hasClass("selected"))
                              {
                              }
                              else
                                  return this.innerHTML;
                          }).get();
  
                          var checkReturnedText = $.trim(restrictionArray[loop_amount]);
  
                          sel.className ="restirction-select";
  
                          var opt = document.createElement("option");
  
                          opt.innerHTML = checkReturnedText;
                          opt.setAttribute("value", checkReturnedText);
                          sel.appendChild(opt);
                          for(var i = 0; i &lt; events.length; i++)
                          {
                              if(checkReturnedText == events[i])
                              {
                              }
                              else
                              {
                                  var opt = document.createElement("option");
                                  var event = events[i];
                                  opt.innerHTML = event;
                                  opt.setAttribute("value", event);
                                  sel.appendChild(opt);
                              }
                          }
  
  
              }
          },
          error:function(){
              alert("An error occured, please try again.");
          }
      });
      return sel;
  </code></pre>