I’m trying to write ‘abc’ into a MQ.TextField
with initial text ‘xyz’
var MQ = MathQuill.getInterface(2);
var mySpan = document.getElementById('A');
var textField = MQ.TextField(mySpan);
textField.latex('abc');
<link href="https://cdnjs.cloudflare.com/ajax/libs/mathquill/0.10.1-a/mathquill.min.css" rel="stylesheet"/>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.7.1/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/mathquill/0.10.1-a/mathquill.min.js"></script>
<span id="A">xyz</span>
I was expecting ‘abc’ in the text field.
When I load the page, however, I get ‘xabc’. The previous first element ‘x’ persists. Why?