2
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

MathJaxで動的な変化を追加するにはTypesetを用いる

Posted at

onclickで数式を表示したい

以下で実現できる。

    const math = document.getElementByID('math');
    btn.onclick = function() {
      math.textContent = '$x + 1$';
      MathJax.Hub.Typeset(math);
    }

MathJax.Hub.Typesetがないとただ

x + 1

と表示されるだけ。

MathJax.Hub.Typesetを記述すれば

$x + 1$

と表示される。

参考記事

2
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?