Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: 93de4a882a
Fetching contributors…

Cannot retrieve contributors at this time

60 lines (55 sloc) 1.743 kb
<!doctype html>
<title>CodeMirror 2: Theme Demo</title>
<link rel="stylesheet" href="../lib/codemirror.css">
<script src="../lib/codemirror.js"></script>
<link rel="stylesheet" href="../theme/default.css">
<link rel="stylesheet" href="../theme/neat.css">
<link rel="stylesheet" href="../theme/elegant.css">
<link rel="stylesheet" href="../theme/night.css">
<link rel="stylesheet" href="../theme/monokai.css">
<link rel="stylesheet" href="../theme/cobalt.css">
<link rel="stylesheet" href="../theme/eclipse.css">
<script src="../mode/javascript/javascript.js"></script>
<link rel="stylesheet" href="../css/docs.css">
<style type="text/css">
.CodeMirror {border: 1px solid black;}
<h1>CodeMirror 2: Theme demo</h1>
<form><textarea id="code" name="code">
function findSequence(goal) {
function find(start, history) {
if (start == goal)
return history;
else if (start > goal)
return null;
return find(start + 5, "(" + history + " + 5)") ||
find(start * 3, "(" + history + " * 3)");
return find(1, "1");
<p>Select a theme: <select onchange="selectTheme(this)">
<option selected>default</option>
var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
lineNumbers: true
function selectTheme(node) {
var theme = node.options[node.selectedIndex].innerHTML;
editor.setOption("theme", theme);
Jump to Line
Something went wrong with that request. Please try again.