fix examples

This commit is contained in:
Dmitry Vasilev
2022-11-08 20:21:29 +08:00
parent c870d70f30
commit 696b5787a9
2 changed files with 36 additions and 6 deletions

View File

@@ -0,0 +1,15 @@
Object.assign(globalThis.document.body, {innerHTML: `
Index:
<input type='number' id='i'>
<br>
Fibonacci number:
<span id='result'></span>
`})
const fib = (i) => {
return i*10
}
globalThis.document.getElementById('i').addEventListener('change', e => {
Object.assign(globalThis.result, {innerText: fib(e.target.value)})
})