Clear task input after submitting

This commit is contained in:
2024-12-02 08:47:17 -08:00
parent dc45b073ab
commit bee9f949d4

View File

@@ -60,7 +60,7 @@ fn index() -> Response {
body {
main {
h1 { "To-do" }
form hx-post="/add" hx-target="#list" hx-swap="innerHTML" {
form hx-post="/add" hx-target="#list" hx-swap="innerHTML" hx-on:submit="this.elements.task.value = ''" {
input type="text" name="task" placeholder="Task";
input type="submit" value="Add";
}