<!DOCTYPE html> <html lang="ja"> <head><title>?????</title> </head> <h1>???????</h1> <body> <script> <form name="form1"> <input type="text" name="input1"> <input type="button" id="test1" value="??"> </form> <p id="test2">????</p> <script> function func1() { let y = document.form1.input1.value; const z = document.querySelector("#test2"); z.textContent = y; } const x = document.querySelector("#test1"); x.addEventListener("click",func1); </script> </html>