Using Javascript's math.js library to produce output with Latex on Wix website

I am able to produce static Latex text on a Wix website by putting something like

<p><span class="math inline">\(\frac{22}{7}\)</span></p>

into an embedded HTML container on a Wix website which produces the fraction 22/7 in nice format. I am also able to do mathematical calculations in Javascript using the math.js library, even taking input from an inputfield on the website.

I cannot, however, combine these things: As an example, imagine I have two inputfields on a website. I want to take the two input numbers, say a and b, and calculate (a - b)/(a+b) and show the result, using Latex, in an HTML container or a textfield. How can I do that?

Thank you very much in advance for your help.
Malte