How to use runmode-standalone for JS/CSS

I was trying runmode-standalone which displays the output but doesnt highlight.

CodeMirror.runMode(box.value, 'text/javascript', document.querySelector('pre'));
--- or ---
CodeMirror.runMode(box.value, 'javascript', document.querySelector('pre'));

Possibly you didn’t load the mode or the style sheets, or the style sheets you loaded don’t match the actual tokens. Hard to say from what you provided.

I found out the problem was with the order of loading the codemirror scripts… :man_facepalming:

AFA mode, which one is correct, ‘text/javascript’ or ‘javascript’?

Those are exactly equivalent if using the JS mode in the distribution.