The send_random() doesn't work when I added it as a directive in the newly added DOM.
...
for (let i = 0; i < items.length; i++) {
data = `
<div class = "block received">
<span class = "item-text">
<button type = "submit" on:click = ${send_random}>
${items[i]['text']}
</button>
</span>
</div>
`;
...
Your help is much appreciated, thank you.