본문 바로가기

스크립트/Keyboard관련

checkbox 선택시 자동입력

<script> 
function FnSelChange() { 
if(document.getElementsByName("Sel_Doc")[0].checked == true ) { 
document.getElementsByName("txt_content")[0].value = "안녕하세요"; 
} else { 
document.getElementsByName("txt_content")[0].value = ""; 


</script> 
<input name="Sel_Doc" type="checkbox" value="자동삽입 테스트" onClick="FnSelChange()"> 
<textarea name="txt_content" cols="68" rows="9"></textarea> 

http://www.ezjob.kr/bbs/board.php?bo_table=web_opencode&wr_id=173&sfl=&stx=&sst=wr_datetime&sod=desc&sop=and&page=1