<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>값 복사 프로그램</title>
<script>
//복사 함수
//2개의 태그를 각각 불러온다
function copy(){
var a = document.querySelector(".a");
var b = document.querySelector(".b");
b.value = a.value;
}
</script>
</head>
<body>
<input type="text" class="a"><br><br>
<input type="text" class="a"><br><br>
<input type="button" value="글자복사">
</body>
</html>
'JAVASCRIPT' 카테고리의 다른 글
| [JAVASCRIPT#07]자바스크립트 이미지 확대 축소 및 응용 (0) | 2020.12.23 |
|---|---|
| [JAVASCRIPT#06]비밀번호 검사 (0) | 2020.12.23 |
| [JAVASCRIPT#04] 자바스크립트 함수, 함수 활용(태그제어) (0) | 2020.12.22 |
| [JAVASCRIPT#03]자바스크립트와 자바의 차이 (0) | 2020.12.22 |
| [JAVASCRIPT#02]Visual Studio Code 설정 (0) | 2020.12.16 |