JSFiddle - React, Tailwind, and code Playground

HTML

<main> <span id="export_text">This text should be exported</span>
    <br>
    <div id="import_text">Here the new text should be after pressing the button</div>
    <hr> <a ><button id="myBtn">run</button></a>

</main>

JavaScript

function run() {
    document.getElementById('import_text').innerHTML = document.getElementById('export_text');
}
document.getElementById("myBtn").addEventListener("click", run);