반응형
Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | ||||
4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 | 12 | 13 | 14 | 15 | 16 | 17 |
18 | 19 | 20 | 21 | 22 | 23 | 24 |
25 | 26 | 27 | 28 | 29 | 30 | 31 |
Tags
- #자바스크립트#접속시간#시간
- #db#데이터베이스#select
- #C언어#for#간단#예제
- #db#where
- #html#프레임
- #alert#자바스크립트#radio#check
- #C언어#scanf#fflush
- #db#order#by
- #C언어#do#while#계산기
- #C언어#if
- #C언어#switch#case#계산기#함수
- #C언어#성적처리#점수#등급
- #증감#연산자
- #html#테이블#table
- #클릭#숨기기#보이기
- #select#from#distinct
- #jQuery#mouse#over
- #C언어#숫자비교#삼항연산자
- #자바스크립트#alert
- #db#froup#by
- #alert#자바스크립트#checkbox#alert
- #db#join#inner#cross
- #자바스크립트#만년달력#달력
- #C언어#타입#printf
- #자바스크립트#텍스트#알람#alert
- #자바스크립트#회원가입#유효성#검사
- #자바스크립트#시계#실시간시계
- #C언어#do#while#계산기#함수
- #getElementById#id
- #C언어#사각형
Archives
- Today
- Total
선택장애
radio box - 클릭시 input box 값 바꾸기 본문
반응형
1. 먼저 radio box, input box를 만들어줍니다.
<input type="radio" value="11"> test11
<input type="radio" value="22"> test22
<input type="radio" value="33"> test33
<input type="text" id="ch_txt">
2. Onclick 이벤트를 추가해줍니다.
<input type="radio" onclick="document.getElementById('ch_txt').value=this.value" value="11"> test11
<input type="radio" onclick="document.getElementById('ch_txt').value=this.value" value="22"> test22
<input type="radio" onclick="document.getElementById('ch_txt').value=this.value" value="33"> test33
<input type="text" id="ch_txt" value="초기값">
3. 기능은 되지만 box와 text의 높이가 안 맞다면
radio box에 style="vertical-align:-2px" 을 추가해줍니다.
반응형
'자바스크립트' 카테고리의 다른 글
접속 기기가 모바일인지 pc인지 체크하기 (0) | 2020.12.24 |
---|---|
check box 클릭시 이벤트 주기 ex) input box 값 바꾸기 (0) | 2020.09.01 |
자바스크립트 - 만년달력 (0) | 2017.08.14 |
자바스크립트 - 회원가입 유효성 검사 (0) | 2017.08.14 |
자바스크립트 - getElementById 간단예제 (0) | 2017.08.14 |