Title: Removing code when pressing the button again.
Last modified: August 20, 2016

---

# Removing code when pressing the button again.

 *  Resolved [stealthrt](https://wordpress.org/support/users/stealthrt/)
 * (@stealthrt)
 * [13 years, 3 months ago](https://wordpress.org/support/topic/removing-code-when-pressing-the-button-again/)
 * I am looking for JS code to allows for the custom button code to be removed from
   the highlighted text. Currently it continues to place the custom html code every
   time you click the button on the same highlighted text.
 * Is there a mod i can do for the JS files that would allow it to remove the custom
   html code when i pretty the button again? Just like it does with the bold button,
   etc?
 * Thanks!
 * [http://wordpress.org/extend/plugins/visual-editor-custom-buttons/](http://wordpress.org/extend/plugins/visual-editor-custom-buttons/)

Viewing 2 replies - 1 through 2 (of 2 total)

 *  Plugin Author [cyberduck](https://wordpress.org/support/users/cyberduck/)
 * (@cyberduck)
 * [13 years, 3 months ago](https://wordpress.org/support/topic/removing-code-when-pressing-the-button-again/#post-3470927)
 * No function for that. But you can use the default eraser-button to remove code.
 *  Plugin Author [cyberduck](https://wordpress.org/support/users/cyberduck/)
 * (@cyberduck)
 * [13 years, 2 months ago](https://wordpress.org/support/topic/removing-code-when-pressing-the-button-again/#post-3471101)
 * Case resolved.

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Removing code when pressing the button again.’ is closed to new replies.

 * ![](https://ps.w.org/visual-editor-custom-buttons/assets/icon-256x256.png?rev
   =1116627)
 * [Visual Editor Custom Buttons](https://wordpress.org/plugins/visual-editor-custom-buttons/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/visual-editor-custom-buttons/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/visual-editor-custom-buttons/)
 * [Active Topics](https://wordpress.org/support/plugin/visual-editor-custom-buttons/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/visual-editor-custom-buttons/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/visual-editor-custom-buttons/reviews/)

 * 2 replies
 * 2 participants
 * Last reply from: [cyberduck](https://wordpress.org/support/users/cyberduck/)
 * Last activity: [13 years, 2 months ago](https://wordpress.org/support/topic/removing-code-when-pressing-the-button-again/#post-3471101)
 * Status: resolved