-
Notifications
You must be signed in to change notification settings - Fork 0
/
test.html
49 lines (49 loc) · 1.96 KB
/
test.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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
<!DOCTYPE HTML>
<html lang="en">
<head>
<meta charset="UTF-8">
<title></title>
<script type="text/javascript" charset="utf-8" src="scripts/dataentry.js"></script>
</head>
<body>
<div>
<textarea name="" id="textarea" rows="8" cols="40"></textarea>
</div>
<div>
<input type="button" id="type" value="type" />
<input type="button" id="stop" value="stop" />
<input type="button" id="delete" value="delete" />
<input type="button" id="retype" value="retype" title="type text in textarea" />
</div>
<div>
<textarea name="" id="textareaClone" rows="8" cols="40"></textarea>
</div>
<div>
<input type="button" id="clone" value="clone" />
</div>
<script type="text/javascript" charset="utf-8">
var dt = DataEntry.makeDataEntry();
document.getElementById("type").onclick = function () {
var input = document.getElementById("textarea");
dt.attachType(input) // attach to input element
};
document.getElementById("stop").onclick = function () {
dt.stop();
};
document.getElementById("delete").onclick = function () {
var input = document.getElementById("textarea");
dt.attachDelete(input);
};
document.getElementById("clone").onclick = function () {
var input = document.getElementById("textarea");
var inputClone = document.getElementById("textareaClone");
dt.attachClone(input, inputClone);
};
document.getElementById("retype").onclick = function () {
var input = document.getElementById("textarea");
var text = input.value;
dt.attachType(input, text) // attach to input element
};
</script>
</body>
</html>