我有以下带有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()