try going in this link: ace.
this ace in html is easy! and check this code snippet:
var editor = ace.edit("editor", {
theme: "ace/theme/tomorrow_night",
mode: "ace/mode/javascript",
});
#editor {
width: 100%;
height: 100vh;
}
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/ace/1.4.13/ace.js"></script>
<div id="editor">function foo(what_is = "h"){
let string = what_is;
return 0;
}</div>
easy, right!
line numbers
syntax highlighting
errors in number lines
choose an theme:
editor.setTheme("ace/theme/tomorrow_night")
choose an mode:
editor.session.setMode("ace/mode/html")
my favorite version is 1.4.13,
so the html code editor uses <script>.