<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>
<input type="text" id="inputTag">
<button onclick="getInput()">클릭</button>
<input type="text" id="inputTag2">
<button onclick="getInput2()">h1태그 출력</button>
<script>
const getInput = () => {
let inputval = document.getElementById('inputTag');
alert(inputval.value);
}
const getInput2 = () => {
let inputval2 = document.getElementById('inputTag2');
document.write(`<h1>${inputval2.value}</h1>`);
}
</script>
</body>
</html>