How to make an event after button press

I want a text to appear 2 second after press of a button and i made one but it doesn’t work can anyone edit it for me or make a new one for me?

$w.onReady(() => {
    $w("#Popuptext").hide();
})
export function button1_click(event) {
    $w('#Popuptext').show('Fade');
}

@advancedassassin-yt Try this:

$w.onReady(() => {
    $w("#Popuptext").hide();
    $w("#myButtonId").onClick(() => showTextAfter2seconds())
})

async function showTextAfter2seconds() {
    await new Promise(r => setTimeout(r, 2000));
    $w('#Popuptext').show('Fade');
}

Thanks a lot for your help, ill just try it out!:grinning:

Hey! it works! thanks again

but it make the the button stop working :frowning: now the button doesn’t redirect me to the link i wanted