# Hiding a button after click

You can hide a button, and reveal alternate text or spinner when the button is clicked

```markup
<button wire:loading.remove wire:target="send" wire:click="send" class="px-4 mt-2">Send Message</button>
<span wire:loading wire:target="send" class="inline-block px-4 my-3 font-bold text-red-700">Sending</span>
```

When the button is pressed, the `wire:loading.remove` will immediately hide the button until the request is complete. The target is itself.  At the same time the span is revealed with the same `wire:loading` and `wire:target` directives. Once the request is complete, the two elements are swapped back.

Use this for long requests (such as sending an email) to prevent multiple requests from the user impatiently pressing the button.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://talltips.novate.co.uk/livewire/hiding-a-button-after-click.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
