You have to us MathJax (or KaTeX) for texts elements. Here is an example:
Add MathJax:
JSXGraph code:
JXG.Options.text.useMathjax = true;
var board = JXG.JSXGraph.initBoard('jxgbox', {boundingbox: [-1, 10, 11, -2], axis: true});
a = board.create('slider',[[-0.7,1.5],[5,1.5],[0,0.5,1]], {
snapWidth: 1,
precision: 0, // digits
suffixlabel:'\\(t_1=\\)',
unitLabel: ' \\(\\text{ ms}\\)'
}),
func = board.create('functiongraph',[function(x){return (a.Value()*x*x)}], {strokeColor: "red"});
text1 = board.create('text', [5, 1, function(){
return '\\(a(t)= { 1 \\over ' + a.Value().toFixed(3) + '}\\)';
}], {fontSize: 15, fixed:true, strokeColor:'red', anchorY: 'top', parse: false});
For styling of buttons the most flexible approach is to set the attribute CssClass since buttons are the usual html buttons.
board.create('button' , [...], {CssClass: 'mybutton'});
Best wishes,
Alfred