<Button> Tag Attributes Remover

The <Button> Tag Attributes Remover is a free, browser-based tool that instantly strips unwanted attributes like class, style, id, and onclick from HTML <button> tags. Whether you re cleaning up legacy code, fixing plugin-generated markup, or preparing HTML for validation, this tool delivers clean, standard-compliant HTML5 in a single click.

Paste your <button> tag below, specify the attributes to remove, and click Remove.

Tip: Type * to remove ALL attributes except those listed under "Preserve".

Step 1: Open the Tool

Save the HTML code as a file (e.g., button-remover.html) and double-click it to open in any browser. No installation or internet needed — it runs entirely offline.

Step 2: Paste Your HTML

In the "Input HTML" box, paste the HTML containing <button> tags you want to clean. For example:

<button type="submit" class="btn btn-primary" id="saveBtn" style="color:red" onclick="save()">Save</button>

Step 3: Set Attributes to Remove

In the "Attributes to remove" field, type the attribute names separated by commas. The default is class, id, style, onclick.

  • To remove only class and style, type: class, style.
  • To remove ALL attributes, type: * (asterisk).

Step 4: Set Preserve List (Important for Buttons)

In the "Preserve (don not remove)" field, list attributes you want to keep. The default is type — this is critical because a <button> without type defaults to type="submit" inside a form, which can cause accidental page reloads.

Recommended preserve list: type, disabled, name, value

Step 5: Click "Remove Attributes"

Press the Remove Attributes button. The cleaned HTML appears in the "Output HTML" box, and a green success message shows below it.

Input:

<button type="submit" class="btn" id="saveBtn" style="color:red" onclick="save()">Save</button>

Output:

<button type="submit">Save</button>

Step 6: Copy the Result

Click the 📋 Copy button at the top-right of the output box. It turns green and shows "Copied!" — the cleaned code is now in your clipboard.

Step 7: Reset (If Needed)

Click ✕ Clear to empty all fields and start over.

7 Views