+++ title = "Reset user input" template = "demo.html" +++ This example shows how to easily reset user inputs using [`hx-on`](@/attributes/hx-on.md), allowing users to make multiple requests without having to manually delete their previous inputs. The inline script will run on the [`afterRequest`](@/events.md#htmx:afterRequest) event and ensures that the form will reset to its initial state as long as the response has a 20x status code: ```html
``` The `reset()` method is only available on `form` elements. For other elements, the input value can explicitly selected and reset to a default to achieve the same result. The following code is functionally equivalent: ```html
``` {{ demoenv() }}