【发布时间】:2020-01-02 16:07:20
【问题描述】:
我有以下带有Deno 运行时的代码,它在网站上显示一个按钮:
- 如何更改此按钮的属性
- 如何为这个按钮添加 eventListner
import { serve } from "https://deno.land/std@v0.24.0/http/server.ts"
async function main() {
const body = new TextEncoder().encode(`<button>click me</button>\n`);
const s = serve({ port: 8000 });
console.log(`Server had been started at: http://localhost:8000/`);
for await (const req of s) {
req.respond({ body });
}
};
main()
【问题讨论】:
-
我建议将此问题标记为
html或DOM而不是deno。 Deno 只是为站点服务,其他的所有 DOM 操作都与浏览器相关。
标签: deno