Email button on dynamic page

I’m not a totally beginner at programming, but I just can’t get this feature to work.

I have a button on a dynamic page (not in a repeater)
In the dynamic dataset there is a field with the ID “kontaktEmail”

I need to fetch that email, and connect it to the button, so when the button is clicked, it uses the mailto: with the email from the dataset.

Anyone? It whould be much appreciated!

Unfortunatly I havnt been able to figure out how to do this as a button, but if you use a text element as a placeholder in the format of an email, it becomes a clickable mailto link, if you then attach that text element to the data, it will work as described as a clickable mailto link that fetches the email from your

I figured it out!

import wixLocation from 'wix-location';

$w.onReady( () => {
       $w('#button20').onClick ( () => {
            const kontaktPerson = $w('#text81').text; 
                 //The text from the textbox from my dynamicpage
            const title = $w('#title').text; 
                 //I needed the title for the subject field in the mail
            const email = ("mailto:"+kontaktPerson+"?subject="+title);
            wixLocation.to(email);
        });
 });