删除文本框问题!
function add()
{
num = num + 1;
if(num>5){
return confirm('最多添加5项!');
}
proportion = new Array();
str='<table>';
str=str+'<tr align=center valign=middle bgcolor=#FFFFFF>';
str=str+'<td><input id=a'+num+' class="txt" type="text" style="width:251px;" name=proportion ></td>';
str=str+'<td><INPUT id="btn'+num+'" class="btn_IndustryID" style="color:Black; font-size:12px;" onclick="funtypeSelect_2(this.id)" value="选择职位" type="button"/> <INPUT id="btn'+num+'s" type="hidden" name="FuntypeID_2"/></td>';
str=str+'<td><a onclick="deleteRow(this)" style="color:#146dac; font-size:12px;TEXT-DECORATION:underline; cursor:pointer;">删除</td>';
str=str+'</tr></table>';
window.upid.innerHTML+=str+'';
for(var i=0;i<num;i++)
{
str2.init().bind(document.getElementById("a"+(i+1)));
}
}
function deleteRow(obj)
{
num=num-1;
alert(num)
obj.parentNode.parentNode.parentNode.deleteRow(obj.parentNode.parentNode.rowIndex);
}
我大于五的时候他删不了,我这里num=num-1的时候他的数字是一直加的,而不是道五删除就不加了,怎么删啊