Fix a problem / DETAILED TASK GUIDE

Fix a button that does nothing

A button can look complete and still have no action, submit the wrong form, or be covered by another element. Trace the click before changing styles or adding another handler.

BY BUILDING APPS WITHOUT CODEUPDATED OCT 14, 2026AI-ASSISTED TASK

Before you start

  • The button, expected action, and reproduction steps.
  • The relevant component and any console or network error.
  • A test environment where the action is safe to exercise.

How to do it

  1. Decide whether this is navigation, a form submission, or a local interaction.
  2. Inspect its type, handler, disabled state, overlay layers, and request path.
  3. Fix the smallest cause. Use a link for navigation and an explicit button type for a non-submit action.
  4. Test one click, keyboard activation, and repeated clicks without triggering unintended duplicate actions.

Before & after

ILLUSTRATIVE EXAMPLE
<button type="button" onClick={openDetails}>Open details</button>

The control performs its intended action and reports failures. The example is JSX and assumes openDetails is defined.

MAKE IT YOURS

Use with an AI coding tool

1 Describe your change

Use your own words. You do not need a file name. The prompt asks the AI to preserve unrelated work.

We remember this choice on this device. Choosing a tool does not connect it to this website.

2 Copy your prompt

Read the complete prompt below, then copy it.

3 Paste into your AI coding tool

Open your website or app project in your AI coding tool. Paste this into its AI chat box and send it. The tool needs access to your project files to make changes.

A website address alone does not give an AI permission or access to edit it. This prompt goes into an AI chat, not a regular terminal window.

4 Check the result

Check success, failure, loading state, and existing surrounding behavior.

Open your project preview and try the change. Review what changed before publishing. If it is wrong, use your tool’s undo or restore your saved project version.

If the result is not what you expected

The handler runs but nothing changes

Follow the state update or network response. A firing event is only one step.

Clicking reloads the page

A button inside a form defaults to submission unless its type is set appropriately.

Undo the change

Restore the specific event or button-type change, then keep the broken action disabled until repaired.

References & testing

The examples above explain the expected behavior; they are not a claim that this prompt has been tested in every framework or AI model. Test the proposed change in your actual project before publishing.

MDN: button element ↗ · Our review approach