-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbrowser-example.html
More file actions
47 lines (41 loc) · 956 Bytes
/
browser-example.html
File metadata and controls
47 lines (41 loc) · 956 Bytes
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Backlash Example</title>
<script src="./lib/reckon.min.js"></script>
<script type="text/javascript" src="./backlash.js"></script>
</head>
<body>
<p id="content">Printing backlash output:</p>
<script type="text/javascript">
/**
* Initialize variables
*/
var firstName = backlash("firstName");
var lastName = backlash("lastName");
var fullName = backlash("fullName");
/**
* Assign values
*/
firstName("John");
lastName("Doe");
fullName("{{firstName}} {{lastName}}");
function updateName() {
document.getElementById("content").innerHTML += "<br>Updated name: " + fullName;
}
//write name in dom
updateName();
//change first name
firstName("Johannes");
updateName();
//change last name
lastName("Dough");
updateName();
//change last name
firstName("Julia");
lastName("Roberts");
updateName();
</script>
</body>
</html>