JSFiddle - React, Tailwind, and code Playground
HTML
<input type="button" value="Export" onclick="exportLog();">
<div id="log">
<p>Action 1 successful</p>
<p>Action 2 unsuccessful </p>
<p>Action 4 - contact admin</p>
<p>...etc</p>
</div>
JavaScript
function exportLog(){
var elHtml = document.getElementById('log').innerText;
var link = document.createElement('a');
var mimeType = 'text/plain';
link.setAttribute('download', 'logFile');
link.setAttribute('href', 'data:' + mimeType + ';charset=utf-8,' + encodeURIComponent(elHtml));
link.click();
}