새소식

Front

[html] select disabled 속성, removeAttr을 사용하여 제거하기

  • -
728x90

요약 : 아애 disabled속성을 제거하면 됩니다.

1
2
3
<script>
    $('#selectTest').removeAttr('disabled'); 
</script>
cs


사용예시 : 

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <title> New Document </title>
  <meta name="Generator" content="EditPlus">
  <meta name="Author" content="">
  <meta name="Keywords" content="">
  <meta name="Description" content="">
 </head>
 
 <body>
 
 <select id="selectTest" disabled>
    <option value="1">1선택!</option>
    <option value="2">2선택!</option>
</select>
 
<script>
    $('#selectTest').removeAttr('disabled'); 
</script>
  
 </body>
</html>
 
cs


반응형
Contents

포스팅 주소를 복사했습니다

이 글이 도움이 되었다면 공감 부탁드립니다.