You can use KaTeX https://katex.org/.
Just copy and paste the contents in head tag and paste it into your html file.
inside body enter latex inside \(latex code here\). You can view it on GitHub It is faster than MathJax. I refered from javascript Katex not renderingYou can view it on Github. it works well with major browser below is a example code with autorendering option.
\(x^2 = \sqrt{y}\)
\(\frac {-b\pm\sqrt{b^2 - 4ac}}{2a}\)