How can I remove a class and add a new class to a field following a changed field?
<p>Here's some background. I hope someone has some ideas. I know some basic jQuery but this is a bit beyond me:</p>

<p>I have the following function:</p>

<pre><code>function updateField(entity, obj, type) {
    var val = obj.val();
    var idArr = obj.attr("id");
    var idTmp = idArr.split("_");
    var id = idTmp[1];
    var pk = $('#Meta_PartitionKey').val();
    var rk = $("div[id='rk_" + id + "']").html(); 
    enableLoadingIcon();
    $.ajax({
        cache: false,
        url: "/Administration/" + entity + "s/Update",
        data: { pk: pk, rk: rk, fld: type, val: val },
        success: function () {
            disableLoadingIcon(); 
        } 
    }); 
};
</code></pre>

<p>This is set up to look for changes here:</p>

<pre><code>  $(document).ready(function () {
      $("input[id^='Position_'], select[id^='Level_'], select[id^='Status_'],").change(function (e) {
          var type = $(this).attr('id').split('_')[0];
          updateField('Link', $(this), type);
      });
  });
</code></pre>

<p>and HTML:</p>

<pre><code>&lt;div class="rep_td0"&gt; 
   &lt;select id="Level_0" name="AdminDetails[0].Level"&gt;&lt;option value="0"&gt;0&lt;/option&gt;
   &lt;option value="1"&gt;1&lt;/option&gt;
   &lt;option selected="selected" value="2"&gt;2&lt;/option&gt;
   &lt;/select&gt;
&lt;/div&gt;
&lt;div class="rep_td0 level_2"&gt;Link2&lt;/div&gt; 
</code></pre>

<p>When the function updateField is called with an entity type of "Level" then I need to change the class of the following 
rep_tdo, remove whatever level is set and change to a Level that matches the choice.  </p>

<p>Can someone help me out here.</p>
