I'd like to display a list of skills and values of a player, and create an increment and decrement button after each line to increase or decrease the value.
(我想显示一个球员的技能和价值的列表,并在每行之后创建一个递增和递减按钮以增加或减少该值。)
I've tried to gather lines from other questions related to this problem, but I'm a beginner and can't solve it. (我试图从与此问题相关的其他问题中收集线索,但是我是一个初学者,无法解决它。)
Here it is my code: (这是我的代码:)
var text = "<ul>";
var i = 0;
for (i; i < this.skillPoints.length; i++) {
text +=
"<li>" +
this.skillPoints[i]._name +
" value is: " +
this.skillPoints[i]._value +
"</li></br>";
var entry = document.createElement('li');
entry.appendChild(document.createTextNode(text));
var btn = document.createElement("BUTTON");
btn.innerHTML = "Increment";
entry.appendChild(btn);
}
text += "</ul>";
document.getElementById("list").innerHTML = text;
ask by DomBar translate from so 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…