two click function on one button

I would like to do something like this:
Button first click: change message
Button second click: open link to send e-mail

could you please help me? Here is the first part of the code I inserted, how do I have to write the second part to send the email?

$w . onReady ( function () {
$w ( ‘#message’ ). text = ‘COMING SOON.’ ;
$w ( ‘#button2’ ). label = ‘ALUGAR O GRIGIO STUDIO’ ;

$w ( '#button2' ). onClick (() => { 
    $w ( '#message' ). text  =  'O ESTÚDIO DO FUTURO!' ; 


  1. What is a “link to send email”? mailto link?, something else? Please post the link (no need to post the actual url, just to clarify what it is). should it opens in the same tab or in a different tab?

  2. What should happen on the 3rd and 4th clicks?

let clicked = false;

        $w('#message').text= 'COMING SOON.';
        $w('#button2').label= 'ALUGAR O GRIGIO STUDIO';
                $w('#message').text= 'O ESTÚDIO DO FUTURO!';
                clicked = true;
                // Do the emailing thing
  1. It should be the normal action when click on button to send an email.

  2. on the first click it should change the message text on the welcome page.

  3. on the second it should send an email.

i solved like this until I get the code done right: I have a #button1 which changes the message when clicked on. Then I created a further identi further #button2 on top of #button1 with the on click email function, but collapsed, and coded so that when I click on #button1 the #button2 will expand and shows up on top of #button1.

If you have a code for me I will replace it, but like this it is working. It would be interesting to know how to code further actions on 3rd and 4th clicks. How can I add this in the code? Do you have an example for me. I am starting to learn VELO so it would be really helpful.

thank you J.D.

Thank you Simen, I will try this.