【发布时间】:2021-08-30 12:12:34
【问题描述】:
你好仁慈的互联网陌生人!我是一个从 c# 转过来的 js 菜鸟,并且已经为一些真正不应该那么困难的事情苦苦挣扎了好几天。我的意图如标题所述,我的无能代码如下:
function Create_button () {
let temp = document.getElementsByTagName("template")[0];
clon = temp.cloneNode;
clon.onclick = someFunction(someparam);
}
<!DOCTYPE html>
<html>
<body>
<script src="Test3.js"></script>
<button onclick="Create_button()">New</button>
<div id="entry_list">
</div>
<template>
<button>Alert</button>
</template>
</body>
</html>
【问题讨论】:
标签: javascript html templates button