<form>
    <div>
        <label for="title">投稿タイトル</label>
        <input type="text" id="title" name="title" value="楽しくHTMLを学ぶ">
    </div>
    <div>
        <label for="content">投稿内容</label>
        <textarea id="content" cols="21" rows="5" name="content">
            楽しくHTMLを学ぶには....
        </textarea>
    </div>
    <button type="submit">投稿を更新</button>

    <!-- ユーザーが確認したり操作したりすることを意図していない値を表す
         非表示のフィールド -->
    <input type="hidden" name="nonce" value="796c7766b1"> <!-- セキュリティトークンとして使用 -->
</form>
ブラウザでの実際の表示例
<form>
    <label for="user-password">ユーザーのパスワード</label>
    <input type="password" id="user-password">
    <button type="submit">送信</button>

    <!-- セキュリティトークンとして使用 -->
    <input type="hidden" name="nonce" value="796c7766b1"> 
</form>
<form method="get" action="/search" role="search">
    <label for="user-search">サイト内検索</label>
    <input
        type="search"
        id="user-search"
        name="query">
    <button type="submit">検索</button>

    <!-- 追加データの送信に使用:ユーザーの位置情報 -->
    <input type="hidden" name="user-locale" value="seoul">
</form>
<form action="/submit" method="post">
    <input type="hidden" name="user_id" value="12345">
    <button type="submit">送信</button>
</form>
<input type="hidden" id="user_id" name="user_id" value="12345">
<button id="submit-button">Submit</button>

<script>
    document.getElementById("submit-button").addEventListener("click", function() {
        const userId = document.getElementById("user_id").value;

        fetch("/submit", {
            method: "POST",
            headers: {
                "Content-Type": "application/x-www-form-urlencoded",
            },
            body: `user_id=${userId}`
        }).then(response => {
            return response.json();
        }).then(data => {
            console.log(data);
        });
    });
</script>
<input type="hidden" name="session_token" value="abcdefg">