@todojs/

01-template

HTML, CSS, JS

No description

fork
loading
Files
  • index.html

This Plugin Crashed!

Error: Error: must not create an existing file {"type":"CREATE_FILE","wid":"0.62427923057469","path":"index.html","file":{"path":"index.html","content":{"asEncoding":{"base64":"PCFET0NUWVBFIGh0bWw+CjxodG1sIGxhbmc9ImVuIj4KPGhlYWQ+CiAgPG1ldGEgY2hhcnNldD0iVVRGLTgiPgogIDx0aXRsZT5UZW1wbGF0ZTwvdGl0bGU+CjwvaGVhZD4KPGJvZHk+Cjx0ZW1wbGF0ZSBpZD0idG1wbHQiPgogIDxoMj5UZW1wbGF0ZSBjb250ZW50PC9oMj4KPC90ZW1wbGF0ZT4KPGJ1dHRvbiBpZD0iY2xvbmUiPkNsb25lIGFuZCBpbnNlcnQgdGVtcGxhdGU8L2J1dHRvbj4KPGRpdiBpZD0icmVzdWx0Ij48L2Rpdj4KPHNjcmlwdD4KICBkb2N1bWVudC5xdWVyeVNlbGVjdG9yICgnI2Nsb25lJykuYWRkRXZlbnRMaXN0ZW5lciAoJ2NsaWNrJywgKCkgPT4gewogICAgY29uc3QgdGVtcGxhdGUgPSBkb2N1bWVudC5xdWVyeVNlbGVjdG9yICgnI3RtcGx0Jyk7CiAgICBjb25zdCBjbG9uZSAgICA9IHRlbXBsYXRlLmNvbnRlbnQuY2xvbmVOb2RlKHRydWUpOwogICAgZG9jdW1lbnQucXVlcnlTZWxlY3RvciAoJyNyZXN1bHQnKS5hcHBlbmRDaGlsZCAoY2xvbmUpOwogIH0pCjwvc2NyaXB0Pgo8L2JvZHk+CjwvaHRtbD4="},"asBuffer":null},"loaded":true}}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>Template</title>
</head>
<body>
<template id="tmplt">
  <h2>Template content</h2>
</template>
<button id="clone">Clone and insert template</button>
<div id="result"></div>
<script>
  document.querySelector ('#clone').addEventListener ('click', () => {
    const template = document.querySelector ('#tmplt');
    const clone    = template.content.cloneNode(true);
    document.querySelector ('#result').appendChild (clone);
  })
</script>
</body>
</html>
result
console