• 회원가입
  • 로그인
  • 구글아이디로 로그인

[attribute] HTML - disabled 속성 - 요소 비활성화 지정 (= disabled속성 = 디스에이블드속성|디세이블드속성) ※ 사용못하게 설정

목차
  1. disabled 예제 - <button> 경우
  2. disabled 정의
  3. disabled 구문
  4. disabled 예제 - <fieldset> 경우
  5. disabled 예제 - <input> 경우
  6. disabled 예제 - <optgroup> 경우
  7. disabled 예제 - <option> 경우
  8. disabled 예제 - <select> 경우
  9. disabled 예제 - <textarea> 경우

 

disabled 예제 - <button> 경우

 

<button type="button" disabled>클릭</button>

 

결과보기

 

disabled 정의

 

요소 비활성화 지정.

 


 

1. disabled 속성 사용 가능 태그 종류

<button>, <fieldset>, <input>, <optgroup>, <option>, <select>, <textarea>

 

2.

  • disabled 지정된 텍스트는 사용 못 함. (즉, 클릭/선택/복사: X)
  • 지정 조건 충족시까지 disalbed 속성 사용해 비활성화 시킨 후, 조건 충족 시 JS로 disabled 속성 제거해 활성화시킬 수도 있음.
  • disabled 지정된 요소의 폼데이터는 서버로 제출 X

 

3.

  • <button> - 모든 브라우저 지원.
  • <fieldset>- 모든 브라우저 지원. (IE11 이하 및 Safari 6 이하 X)
  • <input> - 모든 브라우저 지원.
  • <optgroup> - IE8 이상 모든 브라우저 지원.
  • <option> - IE8 이상 모든 브라우저 지원.
  • <select> - IE9 이상 모든 브라우저 지원.
  • <textarea> - 모든 브라우저 지원.

 

 

disabled 구문

 

  • <button disabled>
  • <fieldset disabled>
  • <input disabled>
  • <optgroup disabled>
  • <option disabled>
  • <select disabled>
  • <textarea disabled>

 


[속성값]

 

없음.

 

 

disabled 예제 - <fieldset> 경우

 

<form action="/action_page.php">

  <fieldset disabled>

    <legend>자기소개</legend>

    <label for="name">이름:</label>

    <input type="text" id="name" name="name"><br><br>

    <label for="nick">별명:</label>

    <input type="text" id="nick" name="nick"><br><br>

    <label for="email">이메일:</label>

    <input type="email" id="email" name="email"><br><br>

    <label for="birthday">생일:</label>

    <input type="date" id="birthday" name="birthday"><br><br>

    <input type="submit" value="확인">

  </fieldset>

</form>

 

결과보기

 

disabled 예제 - <input> 경우

 

<form action="/action_page.php">

  <label for="name">이름:</label>

  <input type="text" id="name" name="name"><br>

  <label for="nick">별명:</label>

  <input type="text" id="nick" name="nick" disabled><br>

  <input type="submit" value="확인">

</form>

 

결과보기

 

disabled 예제 - <optgroup> 경우

 

<form action="/action_page.php">

  <label for="langs">언어 선택</label>

  <select name="langs" id="langs">

    <optgroup label="브라우저측 언어">

      <option value="html">HTML</option>

      <option value="css">CSS</option>

  <option value="js">JavaScript</option>

    </optgroup>

    <optgroup label="서버측 언어" disabled>

      <option value="php">PHP</option>

      <option value="sql">SQL</option>

    </optgroup>

  </select><br>

  <input type="submit" value="확인">

</form>

 

결과보기

 

disabled 예제 - <option> 경우

 

<form action="/action_page.php">

  <label for="langs">언어선택:</label>

  <select name="langs" id="langs">

    <option value="html" disabled>HTML</option>

    <option value="css">CSS</option>

    <option value="js">JS</option>

  </select>

  <br><br>

  <input type="submit" value="확인">

</form>

 

결과보기

 

disabled 예제 - <select> 경우

 

<form action="/action_page.php">

  <label for="langs">언어선택:</label>

  <select name="langs" id="langs" disabled>

    <option value="html">HTML</option>

    <option value="css">CSS</option>

    <option value="js">JS</option>

  </select>

  <br><br>

  <input type="submit" value="확인">

</form>

 

결과보기

 

disabled 예제 - <textarea> 경우

 

<textarea disabled>홈짱닷컴 Homzzang.com</textarea>


결과보기



분류 제목
attribute HTML - readonly 속성 - 읽기전용 설정 (= readonly속성 = 리드온리속성) ※ (읽기만 …
attribute HTML - charset 속성 - 문자셋 지정 (= charset속성 = 차셋속성) ※ 문자인코딩, 언어셋
form HTML - <input type="url"> 태그 - http(s) 프로토콜 형식의 URL 주소 입력 (=…
attribute HTML - onmousewheel 속성 - (폐기예고) 마우스휠 움직일 때 실행 (= onmousewhe…
attribute HTML - onafterprint 속성 - 인쇄 대화상자 닫힌 이후 이벤트 발생 시 실행할 코드 정의 (=…
attribute HTML - oninput 속성 ★ - 사용자 입력값 변경 시 바로 실행 (= oninput속성 = 온인풋속…
form HTML - <input type="search"> 태그 - 검색어 입력 (= 인풋서치타입/서치타입인풋/서치…
attribute HTML - sizes 속성 - 해상도별 이미지나 아이콘, 미디어(오디오/비디오) 등의 크기 지정 (= si…
attribute HTML - shape 속성 - 이미지맵 링크영역 모양 지정 (= shape속성 = 쉐이프속성) ※ 에어리어…
form HTML - <input type="submit"> 태그 - 서버로 데이터 제출/전송 (= 인풋타입서브미트/…
attribute HTML - onload 속성 ★ - 지정 객체가 로드된 경우 실행 (= onload속성 = 온로드속성) ※…
attribute HTML - span 속성 ★ - 테이블 (열/열그룹) 병합 개수 지정 (= span속성 = 스팬속성) ※ …
form HTML - <input type="file"> 태그 - 업로드 할 파일 선택 (= 파일첨부/첨부파일 입력필…
attribute HTML - cite 속성 - (인용출처/삭제이유/삽입이유) 주소 연결 (= cite속성 = 사이트속성)
form HTML - <input type="reset"> 태그 - 입력창 초기화/재설정 (= 입력한 폼데이터 비우기…
attribute HTML - dir 속성 - 텍스트 출력방향 지정 (= dir속성 = 디르속성|디렉션속성)
attribute HTML - async 속성 ★★★ - 비동기적으로 외부스크립트 실행 지정 (= async속성 = 에이싱크속…
attribute HTML - onended 속성 - 미디어 재생 끝날 때 실행 (= onended속성 = 온엔디드속성) ※ …
attribute HTML - translate 속성 - 요소 내용 번역 허용 여부 지정 (= translate속성 = 트랜슬…
attribute HTML - novalidate 속성 - 폼데이터 제출 시, 유효성 평가 생략 (= novalidate속성 …
7/18
목록
찾아주셔서 감사합니다. Since 2012