-
Notifications
You must be signed in to change notification settings - Fork 0
/
mathQuillTesting.html
34 lines (29 loc) · 1.16 KB
/
mathQuillTesting.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
<!DOCTYPE html>
<html lang="en" dir="ltr">
<head>
<meta charset="utf-8">
<title></title>
<link rel="stylesheet" type="text/css" href="http://mathquill.com/support/home.css">
<link rel="stylesheet" type="text/css" href="http://mathquill.com/lib/mathquill.css">
<link rel="stylesheet" type="text/css" href="http://mathquill.com/support/keys.css">
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
<script type="text/javascript" src="http://mathquill.com/lib/mathquill.js"></script>
</head>
<body>
<p>Type math here: <span id="math-field"></span></p>
<p>LaTeX of what you typed: <span id="latex"></span></p>
<script>
var mathFieldSpan = document.getElementById('math-field');
var latexSpan = document.getElementById('latex');
var MQ = MathQuill.getInterface(2); // for backcompat
var mathField = MQ.MathField(mathFieldSpan, {
spaceBehavesLikeTab: true, // configurable
handlers: {
edit: function() { // useful event handlers
latexSpan.textContent = mathField.latex(); // simple API
}
}
});
</script>
</body>
</html>