Reading from the DOM in Mithril

by Ulrich Bangert

HTML

<div id="alert">

</div>

Babel + JSX

var style='body {height: 1px; min-height: 100vh; display: flex; align-items: center; justify-content: center}#alert{display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height:25%;width:25%;padding:2%;border: 1px solid black;box-shadow : 0 0 1em black;background:#aaaaaa;} button {background-color: yellow}';
 
$('<style type="text/css">' + style + '</style>').appendTo($('head'));
document.getElementById('alert').innerHTML='<button id="close" >Schliessen</button>';