<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>