A Pen by Ulrich-Matthias Schäfer on CodePen.
Created
May 13, 2021 10:57
-
-
Save Fuzzyma/64d743369e842c2186b23200ceaf2b6f to your computer and use it in GitHub Desktop.
gOmPyEr
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<svg width="500" height="500"> | |
<foreignObject width="1" height="1" x="10" y="10" style="overflow:visible;"> | |
<pre id="pre"></pre> | |
</foreignObject> | |
</svg> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const el = document.getElementById('pre') | |
// works | |
el.textContent += 'aaaaa' | |
setInterval(() => { | |
// does not work | |
el.textContent += 'a' | |
}, 1000) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pre { | |
background: #f5f5f5; | |
outline: 1px solid black; | |
user-select: auto; | |
display: inline-block; | |
margin: 0; | |
padding: 2px; | |
user-select: none; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment