Varying modal button key:value

Hi all. Im using a modal to display varying content as in this tutorial see link below.

The modal contains a button and I would like for the button to change key:value accordingly like what is achieved with populating text areas. Can someone guide me? I’ve looked into the code but couldn’t create a working output…

Edit problem solved with
***Attribute.dataset.test = value

Just give the button a class (or in the example just use .btn-secondary)

then change the second to last line of the javascript to modal.find(’.yourclass’).text(recipient)

Should do it for you

Hi there, I’ll try that later. Recently I tried with .setAttribute(‘data-name’, ‘recipient’) this work partly but not as desired it does update the attribute but not with the value of the var but as static text “recipient”

Problem was solved with:

***"Attribute.dataset.key = value