title: Javascript List Box Population Not Working
body: <p>It needs to work in IE, if that matters. This is supposed to populate a table cell based on a selection from a listbox. Later on, I'll change the photo to be some HTML that adds their picture to the box.</p>
  
  <p>HTML:</p>
  
  <pre><code>&lt;script src="garver_contact.js" type="text/javascript"&gt;&lt;/script&gt;
  &lt;table class="table table-bordered table-striped"&gt;
      &lt;tr&gt;
          &lt;th&gt;
              &lt;select class="col1 selectTopic"&gt;
                  &lt;option&gt;Payroll&lt;/option&gt;
                  &lt;option&gt;Tax&lt;/option&gt;
                  &lt;option&gt;Accounts Payable&lt;/option&gt;
              &lt;/select&gt;
          &lt;/th&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
          &lt;td class="col1 name"&gt;&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
          &lt;td class="col1 photo"&gt;&lt;/td&gt;
      &lt;/tr&gt;
        &lt;tr&gt;
          &lt;td class="col1 email"&gt;&lt;/td&gt;
      &lt;/tr&gt;
        &lt;tr&gt;
          &lt;td class="col1 phone"&gt;&lt;/td&gt;
      &lt;/tr&gt;
  &lt;/table&gt;
  &lt;script src="contact.js" type="text/javascript"&gt;&lt;/script&gt;
  </code></pre>
  
  <p>Javascript:</p>
  
  <pre><code>data = {
      "contacts":
  {
      "contact": [
  {
      "name": "Payroll",
      "photo": "Emp 1 Photo",
      "email": "emp1@gusa.com",
      "phone": "4113834848"
  },
  {
      "name": "Tax",
      "photo": "Emp 2 Photo",
      "email": "emp2@usa.com",
      "phone": "4113834848"
  },
  {
      "name": "Accounts Payable",
      "photo": "Emp 3 Photo",
      "email": "emp3@usa.com",
      "phone": "4113834848"
  },
      ]
  }
  }
  
  $(".selectTopic").change(function () {
      var jthis = $(this);
      var whichCol;
      if (jthis.hasClass("col1")) {
          whichCol = "col1";
      }
      $.each(data.contacts.contact, function (i, v) {
          if (v.name == jthis.val()) {
              $("td." + whichCol + ".name").html(v.name);
              $("td." + whichCol + ".photo").html(v.photo);
              $("td." + whichCol + ".email").html(v.email);
              $("td." + whichCol + ".phone").html(v.phone);
              return;
          }
      });
  });
  </code></pre>