JavaScript

[js] JS - type 속성 - INPUT 텍스트 타입 반환 (= type속성 = 타입속성)

목차

  1. type 예제 - INPUT 타입 반환
  2. type 정의
  3. type 구문

 

type 예제 - INPUT 타입 반환

 

사이트: <input type="text" id="hz" value="홈짱닷컴">


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


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


<script>

function homzzang() {

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

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

}

</script>

 

결과보기

 

type 정의

 

INPUT 요소의 type 속성값 반환.

 


 

1.

text 타입 필드 경우, 항상 text 반환.

 

2.

모든 브라우저 지원.

 

 

type 구문

 

textObject.type

 


[반환값]

 

텍스트 필드가 어떤 타입인지 문자열로 반환.

 



분류 제목
DOM_Style JS - perspective -
DOM_Style JS - perspectiveOrigin -
DOM_Style JS - position 속성 - 위치기준대상지정 (= 위치속성 = 포지션속성 = position속성, 상속…
DOM_Style JS - quotes -
DOM_Style JS - resize 속성 - 사용자의 요소크기 조정가능여부 지정 (IE는 지원 X)
DOM_Style JS - right -
DOM_Style JS - tableLayout 속성 - 테이블 셀, 행 및 열을 레이아웃 (= table-layout속성 =…
DOM_Style JS - tabSize -
DOM_Style JS - textAlign 속성 ★ - 텍스트 가로/수평 정렬 (= 텍스트 좌측정렬/중앙정렬/우측정렬 = 텍…
DOM_Style JS - textAlignLast -
DOM_Style JS - textDecoration -
DOM_Style JS - textDecorationColor 속성 - 텍스트라인색깔 (= 텍스트데커레이션컬러속성, IE지원X…
DOM_Style JS - textDecorationLine 속성 - 텍스트라인위치 (윗줄,밑줄 등..) (= 텍스트데커레이션…
DOM_Style JS - textDecorationStyle 속성 - 텍스트라인모양 (굵은선, 파선, 점선, 물결선 등) (…
DOM_Style JS - textIndent 속성 - 텍스트 들여쓰기/내어쓰기 (= textIndent속성 = 텍스트인덴트속…
66/89
목록
 홈  PC버전 로그인 일본어
그누앞단언어
그누뒷단언어
그외코딩언어
그누보드
제작의뢰
Q&A
커뮤니티
웹유틸
회원센터
홈짱닷컴 PC버전 로그인