Assigning a widget-popup function to a button or another page element

Learn how to initiate pop-up with a function

This article is for your website support specialist. It will allow you to make a link/button in order to trigger see the Convolo Leads pop-up. It is the one that asks you to fill out the form and promises a callback in X seconds.

Easiest way to do that - use API function

  • For buttons:
// add an attribute
<button onclick=";">OPEN</button>
  • For links:
a href = "#"
onclick = ";" > OPEN < /a>
//or it's possible to assign to existing element using a snippet with **addEventListener:**

if (document.querySelector("#myButtonId"))
    .addEventListener("click", function() {
        if (;

//to assign popup to links <a href=”#callback” ..> it is possible to use a snippet:

    .forEach(el => el.addEventListener("click", function() {
        if (;

If you have any questions, please email us at

Did this answer your question?

Last updated on July 20, 2022