-
-
Notifications
You must be signed in to change notification settings - Fork 111
Expand file tree
/
Copy pathadopt.html
More file actions
42 lines (42 loc) · 818 Bytes
/
adopt.html
File metadata and controls
42 lines (42 loc) · 818 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
<!doctype html>
<html>
<head>
<script defer
src="../index.js"></script>
</head>
<body>
<div test="before"> before
<ul>
<li> lonely </li>
</ul>NO<hr>
</div>
</body>
<script>
this.onload = function () {
update(
hyperHTML.adopt(document.body),
{
test: 'after',
text: 'after',
list: [
{name: 'first'},
{name: 'second'}
],
inBetween: 'YES'
}
);
function update(render, model) {
render`
<div test="${model.test}">
${model.text}
<ul>
${model.list.map(item => `<li> ${item.name} </li>`)}
</ul>
${model.inBetween}
<hr>
</div>
`;
}
};
</script>
</html>