How To Customize The Close Button Title

Do you want to change the text people see when they hover over the close button? It’s easy to customize with OptinMonster! Follow this guide to customize the close button title.

If you want to change the text “Close” that appears when you hover on the close button on the campaign, you can do that by following this guide.

close button title

It is helpful when you are running a multi-lingual website and want the title text to appear in your own language.

To get started you will need to have Unique Campaign Slug & Template Namespace handy.

You can easily find your Campaign Slug in your OptinMonster Dashboard. If you click on the dots under Actions the slug is shown at the bottom and is labeled Unique ID.

dashboard-unique-slug-id

Use the code below to change the title. Change Custom Title Text Here to the title you want to show.

<script type="text/javascript" id="customize-om-close-title-attr">
   jQuery(function ($) {
     $(document).ready(function ($) {
       $(document).on('OptinMonsterLoaded', function( event, data, object ) {
         $('#om-slug .namespace-close').attr('title', 'Custom Title Text Here');
       });
     });
   });
</script>
You will need to modify om-slug and namespace in the above script before adding it to your website.

So if your Campaign Slug is qjqghznasusue0qf and Template Namespace is houston then the correct Javascript will be :

<script type="text/javascript" id="customize-om-close-title-attr">
   jQuery(function ($) {
     $(document).ready(function ($) {
       $(document).on('OptinMonsterLoaded', function( event, data, object ) {
         $('#om-qjqghznasusue0qf .houston-close').attr('title', 'Custom Title Text Here');
       });
     });
   });
</script>

The result will look like this:

close button title live

Need some help adding the code to your website? You can follow our guide if you need help in adding Javascript to your WordPress website.