title: jQuery how to check if attribute exists before removing it
body: <p>I am getting an error <code>object property doesn't support this method</code> when I try to remove the attribute when I load the page.</p>
  
  <p>However I believe this is happening because the disabled attribute was never added on page load, because I do not receive the error after the attribute is added. </p>
  
  <p>My question is how can I check if the attribute exists before trying to remove it. </p>
  
  <p>Thanks</p>
  
  <pre><code> if (jQuery.inArray($("select option:selected").val(), Codes) == -1) {
                  $(serviceSelector).hide();
                  $(LocationSelector).hide();
  
                  $("#ctl00_ctl00_body_body_ddlPool option['value=ADD']").removeAttr("disabled");
                  $("#ctl00_ctl00_body_body_ddlPool option['value=ADM']").removeAttr("disabled");
              } else {
                  $(serviceSelector).show();
                  $(LocationSelector).show();
                  $("#ctl00_ctl00_body_body_ddlPool  option[value=ADM]").attr("disabled", "disabled");
                  $("#ctl00_ctl00_body_body_ddlPool  option[value=ADD]").attr("disabled", "disabled");
  
              }
              //$find(AcId).set_contextKey($(this).val());
          }).change();
  </code></pre>