我的这段代码,调试时正常,但在sever2016下onchange事件会失效,该怎么改?谢谢!
<script type="text/javascript">//在表格中添加新行
$("#picNumberOK").click(function() {
//获取选择的文件数量
let picNumber = document.getElementById("picNumber").value;
if (picNumber > 0)
{
$("#PhotoList tr:not(:first)").remove();//删除表头以下全部行
for (let i = 1; i <= picNumber; i++)
{
let table=document.getElementById("PhotoList");
let tr=document.createElement("tr");
tr.height="150px"
let col_1=document.createElement("td");
col_1.align="center";
col_1.innerHTML=i;
let col_2=document.createElement("td");
col_2.align="center";
let col_3=document.createElement("td");
col_3.align="center";
let col_4=document.createElement("td");
col_4.align="center";
let col_5=document.createElement("td");
col_5.align="center";
col_5.innerHTML="<textarea name=\"explain\" style=\"width:98%;height:140px;border-style:none\" />";
let col_6=document.createElement("td");
col_6.align="center";
col_6.innerHTML="<a class=\"selectfile\">选择图片<input type=\"file\" name=\"imgFile\" id=\"imgFile\" onchange=\"Get()\"></a>";
table.appendChild(tr);
tr.appendChild(col_1);
tr.appendChild(col_2);
tr.appendChild(col_3);
tr.appendChild(col_4);
tr.appendChild(col_5);
tr.appendChild(col_6);
};
}else{
alert("请输入图片数!");
}
});
function Get() {
alert("您已选择了文件!");
};
</script>