Create online HTML, CSS, JS files reader we need codemirror library and input [type="file"] to create online html, css, js reader <link rel="stylesheet" href="https://codemirror.net/lib/codemirror.css"> <link rel="stylesheet" href="https://codemirror.net/doc/docs.css"> <script src="https://codemirror.net/lib/codemirror.js"></script> <script src="https://codemirror.net/mode/css/css.js"></script> <script src="https://codemirror.net/mode/xml/xml.js"></script> <script src="https://codemirror.net/mode/javascript/javascript.js"></script> <script src="https://codemirror.net/mode/css/css.js"></script> <script src="https://codemirror.net/mode/htmlmixed/htmlmixed.js"></script> <input type="file" onchange="localLoad(this.files);" /> <div id="editor"> </div> <script> var myCodeMirror = CodeMirror( document.getElementById('editor'), { mode: "text/html", lineNumbers: true }); function localLoad(files) { if (files.length == 1) { document.title = escape(files[0].name); var reader = new FileReader(); reader.onload = function(e) { myCodeMirror.setValue(e.target.result); }; reader.readAsText(files[0]); } } </script> © 2025 Manajmnt code Share to : ☷✎ Related Save textarea content to local file using file system access API [ demo & source code ] <button id="saveas" save as</button <textarea id="textarea" style="width… Read MoreHTML tags remover online Are you tired of manually deleting HTML tags? Save time and delete them with one click A… Read MoreHow-to paste text from clipboard automatically onload page paste text,clipboard, javascript discover How-to paste text from clipboard automatically onloa… Read More Comments
Comments
Post a Comment
message