如何从数组中更改一个句子?

时间:2019-06-29 18:51:05

标签: javascript

我创建了一个数组和一个从该数组中选择随机单词/句子的函数,但是我无法创建一个在单击按钮后更改当前单词/句子的函数。

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.

0 个答案:

没有答案