javascriptについてなのですが,valueを取得する意味がよくわかりません。
<form action='URL' id='form'> <input type='text' name='word'> <input type='submit' value='検索'> </form> <p id='output'></p> <script> document.getElementById('form').onsubmit=function(){ const search=document.getElementById('form').word.value; document.getElementById('output').textContent=`「${search}」の検索中` }; </script>
form,wordの取得が必要なのはわかるのですが,valueの取得がいったい何に利用されているのかがよくわかりません。ネットで調べたもののうまく理解できず...。
ご教授いただけると幸いです。

回答2件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2021/04/08 11:03
2021/04/08 11:19
2021/04/08 11:20
2021/04/08 12:43
2021/04/08 13:18
2021/04/08 13:52