How to trigger a popup with a click?
The following article applies to our brand new Forms and Popups editor. Legacy editor help can be found here.
You can now configure the form so that it pops up when your website visitor clicks on a button or link of your choice. You can combine on click trigger with different triggers, you can learn more about other triggers here.
Setting up the on click trigger
To setup on click trigger for your popup:
- Go to Forms and popups and click on the name.
- Click Edit under Display rules.
- Click Edit triggers to select the action that will make the popup appear.
- Select On Click.
- Enter CSS selector which identifies the HTML element that, when clicked, opens the popup. Check examples of the trigger below. If you can’t access your site’s code, consult your developer.
- Click Apply.
Examples of CSS Selectors
A CSS selector is a pattern used in web development to target and style specific HTML elements on a webpage. When setting up an On click trigger for your popup form in GetResponse, the CSS selector identifies the button or link that visitors need to click to trigger the popup.
Imagine you have a button on your website with the following HTML code:<button class="subscribe-button">Subscribe Now</button>
To use this button as the trigger for your popup form, you would set the CSS selector to target it. For example:
- To target it by its class (this will work for every HTML element in this class):
.subscribe-button
- To target it by its HTML tag and class (that may work for every button in this class):
button.subscribe-button
- To target a button with a specific ID (if the button had
id="subscribe"
):#subscribe
The selector by Id/#
finds the first matching element and the click will be registered on it only. Selector by class
works on many elements, just like other selectors. The Id/#
selector is unique in this aspect.
If you would like the click to run on exactly what you want, make sure the selector is unique.
Setting up an On click trigger using CSS selectors requires basic knowledge of HTML and CSS. If you’re unfamiliar with these concepts or the structure of your website’s code, we recommend consulting your web developer.
Please note that GetResponse does not provide technical support for setting up CSS selectors. However, if you need general guidance, you can refer to online resources or seek assistance from a professional.