diff options
author | Grail Finder (aider) <wohilas@gmail.com> | 2025-03-29 14:40:08 +0300 |
---|---|---|
committer | Grail Finder (aider) <wohilas@gmail.com> | 2025-03-29 14:40:08 +0300 |
commit | 8e9c2e827da72980f9efb3bb6859a289f930119a (patch) | |
tree | 9353398bab3cd280605589bc11f746e9fd0ab76c | |
parent | b276143b38c6e273126918fd92b5903a6293b1d9 (diff) |
feat: add interactive option buttons with HTMX
-rw-r--r-- | components/index.html | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/components/index.html b/components/index.html index 0e58af2..5626dbd 100644 --- a/components/index.html +++ b/components/index.html @@ -14,7 +14,17 @@ {{.Text}} </div> <div> - <!-->here we need to iterate through {{.Options}} and make them selectable; ai!<--> + {{range $index, $option := .Options}} + <button + hx-post="/answer" + hx-vals='{"selected": "{{$index}}"}' + hx-target="#ancestor" + hx-swap="outerHTML" + class="option-button" + > + {{$option}} + </button> + {{end}} </div> </div> </body> |