<img src='plus.jpg' width='80' height='80' onclick="myFunction2()">
function myFunction2() {
var x = document.createElement("INPUT");
x.setAttribute("name", "image[]");
x.setAttribute("type", "file");
document.getElementById("add").appendChild(x);
}
我想用myFunction2()仅有4次。 之后,我想停止这个功能。 你能给我任何建议吗? 在此先感谢。
如何使用循环语句? –
我做到了,但我不知道索引号的确切位置...... @RajaprabhuAravindasamy –
https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Statements/for –