-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathexample.html
37 lines (28 loc) · 876 Bytes
/
example.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
<!DOCTYPE html>
<html>
<head>
<title>Lorem.js example</title>
<meta charset="utf-8">
<script type="text/javascript" src="lorem.min.js"></script>
</head>
<body>
<button onclick="javascript:doGetWord();">Lorem.getWord()</button>
<button onclick="javascript:doGetSentence();">Lorem.getSentence()</button>
<button onclick="javascript:doGetParagraph();">Lorem.getParagraph()</button>
<label><input id="checkbox" type="checkbox"> Start with 'Lorem ipsum'</label>
<p id="output"></p>
<script type="text/javascript">
var output = document.getElementById("output");
var checkbox = document.getElementById("checkbox");
function doGetWord(){
output.innerHTML = Lorem.getWord();
}
function doGetSentence(){
output.innerHTML = Lorem.getSentence(checkbox.checked);
}
function doGetParagraph(){
output.innerHTML = Lorem.getParagraph(checkbox.checked);
}
</script>
</body>
</html>