当我在页面点添加的时候。生成多个file但ID都为:id="图片C",id不是标签的唯一标识么。怎么可以相同。相同不会报错?
//添加文本框
function addFile() {
if ($("#addFile input").length == 5) {
alert("添加个数已到达5个");
return;
}
//创建行
var $tr = $("<tr></tr>");
$("#addFile").append($tr); //创建单元格
$td = $("<td><span><input id='图片C' type='file' name='guid' onchange='fileEven(this)'/></span></td>");
$tr.append($td); $tr.append($("<td></td>"));
var $td = $("<td><a href='javascript:void()' id='cancel' style='color: blue; text-decoration: none' onfocus='this.blur()'>取消</a></td>");
$tr.append($td);
//$tr.prepend
}
//添加文本框
function addFile() {
if ($("#addFile input").length == 5) {
alert("添加个数已到达5个");
return;
}
//创建行
var $tr = $("<tr></tr>");
$("#addFile").append($tr); //创建单元格
$td = $("<td><span><input id='图片C' type='file' name='guid' onchange='fileEven(this)'/></span></td>");
$tr.append($td); $tr.append($("<td></td>"));
var $td = $("<td><a href='javascript:void()' id='cancel' style='color: blue; text-decoration: none' onfocus='this.blur()'>取消</a></td>");
$tr.append($td);
//$tr.prepend
}
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货