|
@@ -58,6 +58,10 @@ function getRandomInt(min, max) {
|
|
return Math.floor(Math.random() * (max - min) + min); //The maximum is exclusive and the minimum is inclusive
|
|
return Math.floor(Math.random() * (max - min) + min); //The maximum is exclusive and the minimum is inclusive
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+function getOneFromArray(arr) {
|
|
|
|
+ return arr[getRandomInt(0, arr.length)];
|
|
|
|
+}
|
|
|
|
+
|
|
// 该函数用于创建一个<eleName k="attrs[k]">text</eleName>样式的页面元素
|
|
// 该函数用于创建一个<eleName k="attrs[k]">text</eleName>样式的页面元素
|
|
function createEle(eleName, text, attrs) {
|
|
function createEle(eleName, text, attrs) {
|
|
let ele = document.createElement(eleName);
|
|
let ele = document.createElement(eleName);
|