我创建了一个数组和一个从该数组中选择随机单词/句子的函数,但是我无法创建一个在单击按钮后更改当前单词/句子的函数。
var p = document.createElement("p");
p.setAttribute("id","p1");
var node = document.createTextNode("This is new");
p.appendChild(node);
var parent = document.getElementById("activity");
var child = document.getElementById("description");
parent.replaceChild(,);
// are the things that I know I have to use, but can't apply
correctly/properly. The button and random word/sentence chooser work just
fine.