hx-trigger hands-on
<form action="" class="acms-form" method="post"> <input type="hidden" name="bid" value="1"> <input type="hidden" name="cid" value=""> <input type="hidden" name="query" value="keyword"> <input type="text" name="keyword" value="" placeholder="検索キーワード" class="acms-form-width-small"> <input type="submit" name="ACMS_POST_2GET" value="検索" class="acms-btn"> </form> <div id="result-post" class="demo">このコンテンツが変わります</div>
hx-post と同じフォームです。ここで(検索)を押さないで、キーを入力した時点 hx-trigger="keyup" で htmx を動作させることにチャレンジしてみましょう。
ヒント: hx-getの練習・hx-postの練習 を参考にしてください。
このコンテンツが変わります