How do I make a button change the label in another button when clicked?

I have a button (Button A) with the label $25. When the user clicks on that button (Button A), I want it to change the label of another - previously hidden - button (Button Z) at the bottom of the page to show $25. From what I understand, it’s using the onClick event code…but I can’t work out the exact code. Is there an example on the site that I can work from?

Hi,
I understand you’re trying to make 2 actions once button 1 is clicked:

  1. update the label of button 2 to be the same as the current label of button 1.
  2. unhide button 2 (which was previously hidden).
    Please look at the code below that performs these 2 actions:
// (button 2 is hidden)

export function button1_click(event) {

 // update the label of '#button2' to be the same as #button1
 let buttonLabel = $w("#button1").label;
    $w("#button2").label = buttonLabel;

 // show '#button2'
    $w("#button2").show();
}