Toggle Button Text with Internationalization

Life is easier with data attributes, but for some reason not everybody is using it to improve the JavaScript flexibility, especially for multilingual websites. Here is one example how you can create buttons with a dynamic text. In my example I am using alternating text for a preview and edit method.