MathLive Example

Experiment with the options available to setup and customize a mathfield with the Playground below. Edit the HTML and JavaScript section for the interactive result to update right away.

import 'mathlive'; const mf = document.querySelector('#formula'); const latexField = document.querySelector('#latex'); latexField.addEventListener('input', () => mf.setValue(latexField.value) ); function updateLatex() { document.querySelector('#latex').value = mf.value; } mf.addEventListener('input', updateLatex); updateLatex();
<math-field id="formula" virtual-keyboard-mode=manual> x=\frac{-b\pm \sqrt{b^2-4ac}}{2a} </math-field> <textarea id="latex"></textarea>