Skip to content

Instantly share code, notes, and snippets.

@Fuzzyma
Created May 13, 2021 10:57
Show Gist options
  • Save Fuzzyma/64d743369e842c2186b23200ceaf2b6f to your computer and use it in GitHub Desktop.
Save Fuzzyma/64d743369e842c2186b23200ceaf2b6f to your computer and use it in GitHub Desktop.
gOmPyEr
<svg width="500" height="500">
<foreignObject width="1" height="1" x="10" y="10" style="overflow:visible;">
<pre id="pre"></pre>
</foreignObject>
</svg>
const el = document.getElementById('pre')
// works
el.textContent += 'aaaaa'
setInterval(() => {
// does not work
el.textContent += 'a'
}, 1000)
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