For starters, TeX is Turing-complete, and the tokenizer is arbitrarily reprogrammable at runtime.
Okay then, what would stop you rendering TeX to SVG and embedding that?
Edit: Genuine question, not rhetorical - I don't know how well it would work but it sounds like it should.
Browsers already support JavaScript anyway, so why not add another Turing-complete language into the mix? (Not even accounting for CSS technically being Turing-complete, or WASM, or …)