class value not changing on jquery selector

class value not changing on jquery selector

  1. <script>
  2.          $(document).ready(function () {
  3.              var radioselected;
  4.              $('#radioContactTasks input[type=radio]').change(function() {
  5.                  $('#contacttype').removeClass("invisible");
  6.                  $('#contacttype').hasClass("visible");
  7.                  radioselected = $(this).val();
  8.              });
  9.              $('#contacttype select').change(function () {
  10.                  $('#contacttype').removeClass("invisible");
  11.                  $('#contacttype').hasClass("visible");
  12.                  if (radioselected === "Edit Existing Contact") {
  13.                      //alert('yoyo');
  14.                      $('#editcontact').removeclass('invisible');                     
  15.                  } else if (radioselected === "Add New Contact") {
  16.                     // alert('yoyo2');                   
  17.                  } else {
  18.                      //alert('yoyo3');                 
  19.                  }
  20.              });
  21.         });
  22. </script>
    The script works fine to change the contacttype class back and forth
It doesnt however make the editcontact div visible in the markup below. In the first if option the code is run to toggleclass to visible but it doesnt change. Something may be wrong in the markup. Any help appreciated.

  1.     
  2.  <div id="editcontact" class="invisible" >
  3.         <fieldset style="width:60%;">
  4.             <legend>Edit an Existing Contact</legend>
  5.            <asp:DropDownList ID="ddlContacttoEdit" runat="server" CssClass="dropdowns"/>
  6.             <asp:UpdatePanel runat="server" >
  7.                 <ContentTemplate>
  8.                     <asp:DetailsView ID="dvEditContacts" runat="server" Height="50px" Width="125px"
  9.                                 AutoGenerateEditButton="True" CssClass="mGrid">
  10.                     </asp:DetailsView>
  11.                 </ContentTemplate>
  12.                 <Triggers>
  13.                     <asp:AsyncPostBackTrigger ControlID="ddlContacttoEdit" EventName="SelectedIndexChanged"/>
  14.                 </Triggers>
  15.             </asp:UpdatePanel>
  16.         </fieldset>
  17.     </div>