The easiest way to do that is with Interactor by Gloo.
What is Interactor?
Interactor is a jQuery engine to generate custom triggers and events, all in your Elementor editor UI. Among these triggers and events there's a way to create a browser alert on the click of a button, but there's many other triggers that can be used to generate any event you may want to fire.
Create the browser alert of your choice.
Create a button on your Elementor page and give it an ID of your choice.
We’re going with a button for this example, but there are plenty of ways to trigger alerts. Click on the Gloo icon to the left of the hamburger menu in the header of the Elementor settings, Or navigate to your Page Settings, and you will find Interactor in the Advanced Tab. Here is where we make the magic happen.
Navigate to Triggers, and click on Add Item. Give the trigger a title, select Click among the many firing events, and specify the #ID of the button. We’ll be back here later, but notice how using Interactor Extensions, we can fire DataLayers, Zaps through Zapier, and even other actions through a custom WebHook, all with the same trigger.
Navigate to Events, and click on Add Item. Once again, give the event a title, select Interaction among the events, and specify the Alert interaction. Under Parameter, write what the text of the alert will be. You can set a delay, which device the event will fire on, and more.
Navigate back to Triggers, and select the event you just created in Event to Fire. Save and refresh if it doesn’t show up immediately. Save once again, and you’re set! It’s as easy as that. You can now check for yourself. The alert will be working on the finished page! The process works just the same with any other trigger, and any other events included in Interactor. Discover not just simple interactions, but also complex emulations, animations, and custom functions.