<script type="text/javascript">
// 기존코드
if ( slt_SF_CLS.disabled == true ) {
}

// 위와 같은 코드를 아무생각 없이 jQuery를 이용해서 아래와 같이 변경했더니 안됐다.
// 이걸 어떻게 찾아 ㅡㅡ;
if ( $(slt_SF_CLS).attr("disabled") == true ) {
}

// 암튼 출력 해보면

$(slt_SF_CLS).attr("disabled", false);
alert($(slt_SF_CLS).attr("disabled"));    // undefined
$(slt_SF_CLS).attr("disabled", true);
alert($(slt_SF_CLS).attr("disabled"));    // disabled

// readonly attribute도 마찬가지 이다.

$(slt_SF_CLS).attr("readonly", false);
alert($(slt_SF_CLS).attr("readonly"));    // udefined
$(slt_SF_CLS).attr("readonly", true);
alert($(slt_SF_CLS).attr("readonly"));    // readonly


</script>

// HTML
<select id="slt_SF_CLS" name="slt_SF_CLS">
</select>


'JavaScript > jQuery' 카테고리의 다른 글

[jQuery] val 메소드 getter, setter 구별법  (0) 2012.08.30
[jQuery] PlugIn 만들기  (0) 2012.08.08
[jQuery] .each $.each 순회중 continue, break 하기  (0) 2012.07.26
[jQuery] ajaxForm 구현  (0) 2012.07.23
[jQuery] Plugin Validation  (0) 2012.06.18
posted by 뚱2