ejsの変数を裏でnode.jsに引き渡したいです。
まずやりたいこととしては、ユーザーがEXITボタンを押したとき、node.jsに変数numberをpostする。
という内容です。
htmlからnode.jsにpostできるのはinputやselect属性だけなのでしょうか...
また、変数をpostする用のタグがほかにもあるのでしょうか...
初心者質問ではございますが、回答していただけると幸いです。
ejs
1<!DOCTYPE html> 2<html lang="en"> 3<head> 4 <meta charset="UTF-8"> 5 <meta http-equiv="X-UA-Compatible" content="IE=edge"> 6 <meta name="viewport" content="width=device-width, initial-scale=1.0"> 7 <title>Document</title> 8</head> 9<body> 10 <form action="/postsql" method="post"> 11 <header> 12 <a> 13 <h2>EXIT</h2> 14 </a> 15 </header> 16 </form> 17 -- 省略 -- 18 <script> 19 let number=12345 20 </script> 21</body> 22</html>

回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
退会済みユーザー
2022/06/16 09:02