강호동
위의 텍스트박스에 체크박스 체크를 하면 위처럼 강호동이라고 써졌으면 좋겠는뎅..
어떻게해야하졍,..ㅠ
!!
위의 텍스트박스에 체크박스 체크를 하면 위처럼 강호동이라고 써졌으면 좋겠는뎅..
어떻게해야하졍,..ㅠ
!!
댓글을 작성하시려면 로그인이 필요합니다.
댓글 6개
function val_in(el, t_el) { // el : this, t_el : target
if (typeof t_el == 'string') t_el = document.getElementById(t_el);
if (t_el == null) return false;
t_el.value= el.value;
}
</script>
<label><input type="radio" name="s" value="강호동" onclick="val_in(this, 's2')"> 강호동</label>
<input type="text" name="s2" id="s2">
걍 간단하게 인라인으로 ㅋ.
강호동 강호동2 가 텍스트로 나오게 할수있는방법이없을까요..ㅠㅠ!!
요 부분을
if (t_el.value == '') t_el.value = el.value;
else t_el.value += ' ' + el.value;
이렇게 ㅋ......