JavaScript

[HTML_Objects] JS - <input type="color"> 객체 - color타입 input태그 (= 인풋컬러태그) ※ 색깔/색상 입력필드

목차
  1. <input type="color"> 객체 정의 - 컬러형 인풋
  2. <input type="color"> 객체 구문
  3. <input type="color"> 객체 예제 - 접근
  4. <input type="color"> 객체 예제 - 생성
  5. <input type="color"> 객체 속성

 

<input type="color"> 객체 정의 - 컬러형 인풋

 

HTML <input type="color"> 태그(요소) 의미.

(IE11 이하 / Safari 9.1 이하 경우, 지원 X)

 

 

<input type="color"> 객체 구문

 

[접근]

var x = document.getElementById("요소ID");

또는,

var x = document.getElementById("폼요소ID").elements;

 

[생성]

var x = document.createElement("INPUT");

x.setAttribute("type", "color");

 

 

<input type="color"> 객체 예제 - 접근

 

 

좋아하는 색 고르기 : <input type="color" id="hz">


<button onclick="homzzang()">클릭</button>


<p id="demo"></p>


<script>

function homzzang() {

  var x = document.getElementById("hz").value;

  document.getElementById("demo").innerHTML = x;

}

</script> 

 

결과보기


<input type="color"> 객체 예제 - 생성

 

<button onclick="homzzang()">클릭</button>


<script>

function homzzang() {

  var x = document.createElement("INPUT");

  x.setAttribute("type", "color");

  document.body.appendChild(x);

}

</script> 

 

결과보기 

 

<input type="color"> 객체 속성

 

autocomplete

색상 선택기의 autocomplete 속성값 설정/반환.

 

autofocus

페이지를 로드할 때 색상 선택기가 자동으로 focus 갖는지 여부 설정/반환.

 

defaultValue

색상 선택기의 기본값 설정/반환.

 

disabled

색상 선택기가 비활성화되어 있는지 여부를 설정/반환.

 

form

색상 선택기 포함하는 양식에 대한 참조 반환.

 

list

색상 선택기를 포함하는 <datalist> 요소에 대한 참조 반환.

 

name

색상 선택기의 name 속성값 설정/반환.

 

type

색상 선택기가 어떤 유형의 양식 요소인지 반환.

 

value

색상 선택기의 value 속성값 설정/반환. 

 

※ <input type="color"> 객체는 표준 속성/메서드/이벤트 지원.

 

방문 감사합니다. (즐겨찾기 등록: Ctrl + D)

분류 제목
DOM_Style JS - animationPlayState 속성 - 애니재생상태 (= 애니작동상태설정 = 움직임 재생/멈춤 …
DOM_Style JS - background 속성 ★ - (배경색/배경이미지) 설정/반환 (= background속성 / 백…
DOM_Style JS - backgroundAttachment 속성 ★ - 배경이미지고정 설정/반환
DOM_Style JS - backgroundColor 속성 ★ - 배경색 설정/반환. (= backgroundColor속성 …
DOM_Style JS - backgroundImage 속성 ★ - 배경이미지 설정/반환 (= backgroundImage속성…
DOM_Style JS - backgroundPosition 속성 - 배경이미지위치 설정/반환
DOM_Style JS - backgroundRepeat 속성 - 배경이미지반복 설정/반환
DOM_Style JS - backgroundClip 속성 - 배경 영역 (= backgroundClip속성 = 백그라운드클립…
DOM_Style JS - backgroundOrigin 속성 - 배경이미지 좌표시작점 설정/반환 (= 백그라운드오리진 속성)
DOM_Style JS - backgroundSize 속성 ★ - 배경이미지크기 설정/반환 (IE9 이상)
DOM_Style JS - backfaceVisibility 속성 - 3D요소 뒷면노출 설정/반환 (IE10 이상)
DOM_Style JS - border 속성 ★ - 테두리스타일 설정/반환 (= 보더속성 = border속성)
DOM_Style JS - borderBottom 속성 - 테두리하단 (= border-bottom속성 = 하단테두리 = 보더…
DOM_Style JS - borderBottomColor 속성 - 테두리하단색깔 (= 보더바텀컬러속성 = border-bot…
DOM_Style JS - borderBottomLeftRadius 속성 - 테두리하단왼쪽모서리둥글게 (= 테두리 하단좌측둥글…
57/89
목록
  • 채팅방
  • 필독
1. 채팅창 헤드에서 접속자 확인 2. 닉네임 클릭해 1:1 채팅 가능 3. 닉네임 클릭해 귓속말 가능 4. 닉네임 클릭해 호출하기 가능 5. 우하단 클릭해 환경 설정 가능 6. 의뢰글 작성 후 의뢰 상담 가능 7. 질문글 작성 후 질문 상담 가능 8. 채팅방에 개인정보 입력 금지 9. 채팅방에 광고 욕설 비방 금지
 홈  PC버전 로그인 일본어
웹디자인언어
서버관리언어
고급코딩언어
그누보드
제작의뢰
Q&A
커뮤니티 1
웹유틸
회원센터
홈짱 PC버전 로그인