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

[HTML_Objects] JS - <input type="button"> 객체 - button타입 input태그 (= 인풋버튼태그)

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

 

<input type="button"> 객체 정의 - 버튼형 인풋

 

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

 

 

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

 

[접근]

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

또는,

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

 

[생성]

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

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

 

 

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

 

<input type="button" id="hz" onclick="homzzang()" value="Homzzang.com">


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


<script>

function homzzang() {

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

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

}

</script> 

 

결과보기

 

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

 

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


<script>

function homzzang() {

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

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

  x.setAttribute("value", "Homzzang.com");

  document.body.appendChild(x);

}

</script> 

 

결과보기 

 

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

 

autofocus

페이지 로드 될 때 입력 버튼이 자동으로 focus 가져야하는지 여부 설정/반환.

 

defaultValue

입력 버튼의 기본값 설정/반환.

 

disabled

입력 버튼의 비활성화 여부 설정/반환.

 

form

입력 버튼이 포함된 폼에 대한 참조 반환.

 

name

입력 버튼의 name 속성값 설정/반환.

 

type

입력 버튼의 양식 요소 유형 반환.

 

value

입력 버튼의 value 속성 값을 설정/반환. 

 

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


분류 제목
HTML_Objects JS - <address> 객체 - 연락처 (= address태그 = address요소 = 어드레스태그)
HTML_Objects JS - <area> 객체 - 이미지맵 링크 영역 (= area태그 = 에어리어태그) (HTML5수정)
HTML_Objects JS - <article> 객체 ★ - 자족적인 독립콘텐츠 (= 아티클태그 = article태그. IE9)
HTML_Objects JS - <aside> 객체 ★ - 관련별도콘텐츠표시 (= 부가콘텐츠 = 어사이드태그 = aside태그) (…
HTML_Objects JS - <audio> 객체 ★ - 음성파일재생 (=오디오태그 = audio태그) ※ 음성파일형식별로 브라우…
HTML_Objects JS - <b> 객체 ★ - 굵은글씨 (= b태그 = b요소 = 폰트굵기 = 비태그 = 볼드태그 = bol…
HTML_Objects JS - <base> 객체 - 상대주소 기본 URL/타켓 지정 (= base 태그 = 베이스 태그)
HTML_Objects JS - <bdo> 객체 - 텍스트출력방향 (= bdo태그 = bdo요소 = 글자방향 = 브도태그 = 비도태…
HTML_Objects JS - <blockquote> 객체 ★ - 긴 인용구 (= blockquote태그 = blockquote요…
HTML_Objects JS - <body> 객체 ★ - 문서영역 (= body태그 = body요소 = 본문영역 = 바디태그 = 보…
HTML_Objects JS - <br> 객체 ★ - 줄바꿈 (=br태그 = br요소 = 한줄아래로 = 비알태그 = 브르태그 = 브…
HTML_Objects JS - <button> 객체 ★ - 클릭버튼 (= button태그 = 버튼태그) (HTML5수정)
HTML_Objects JS - <canvas> 객체 - 그림그리기 (= canvas태그 = 캔버스태그) (IE9 이상. HTML추…
HTML_Objects JS - <caption> 객체 - 테이블제목 (= 표제목 = caption태그 = 캡션태그) (HTML5 …
HTML_Objects JS - <cite> 객체 - 인용구 제목 (= cite태그 = cite요소 = 저작물제목 = 인용태그 = …
HTML_Objects JS - <code> 객체 - 컴퓨터소스코드 출력 (= code태그 = 코드태그)
HTML_Objects JS - <col> 객체 - 테이블열그룹 (= col태그 = 콜태그) (HTML5 수정)
HTML_Objects JS - <colgroup> 객체 - 테이블의 col태그묶음 (= colgroup태그 = 콜그룹태그, HTM…
HTML_Objects JS - <datalist> 객체 - 입력가능값리스트 (= datalist태그 = 데이터리스트태그) (IE1…
HTML_Objects JS - <dd> 객체 - 항목세부설명 (= dd태그 = 디디태그)
55/67
목록
찾아주셔서 감사합니다. Since 2012