Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
[jQuery] Toggle multiple buttons at same with different text
disableCta: function() {
this.prop('disabled', true);
// or use your own class
// retain current text of the CTA in custom data attribute
// Used html() assuming it is a <button> element
this.attr('data-value', this.html());
// or use whatever text to show while waiting
return this;
enableCta: function() {
this.prop('disabled', false);
// or use your own class
// restore original text for the CTA
// Used html() assuming it is a <button> element
// Remove custom data attribute from CTA
return this;
// Use
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.