본문 바로가기

개발하자/자바스크립트

focus()

<html>
 <head>
 <script>
 function e(){
  a.value="";
  b.value="";
 a.focus();  --커서위치 셋팅
 }
 function f(){
  b.value=a.value;
 }
 </script>
 </head>
 <body>
 <input type="text" value="" id="a">
 <input type="text" value="" id="b"><br>
 <input type="button" value="지우기" id="c" onclick="e()">
<input type="button" value="복사" id="d" onclick="f()">

 </body>
</html>

'개발하자 > 자바스크립트' 카테고리의 다른 글

html 리스트  (0) 2015.02.10
테두리 바꾸기(borderStyle)  (0) 2015.02.07
지우기,복사  (0) 2015.02.07
배열사용  (0) 2015.02.07
주석  (0) 2015.02.07