<div class="codetitle"> <span><a style="CURSOR: pointer" data="32064" class="copybut" id="copybut32064" onclick="doCopy('code32064')"><u>复制代码</u></a></span>代码如下:</div> <div class="codebody" id="code32064"> <br><script type="text/javascript" src="js/ jquery-1.7.1.min.js"></script> <BR><スクリプト> <BR>$(function(){ <BR>$("#getAtr").click(function(){ <BR>$str=''; <BR>$str ="<tr align='center' >"; <br>$str ="<td><input type='text' name='advTitle[]'/></td>"; <br>$str ="<td> ;<input type='file' name='img[]' /></td>"; <br>$str ="<td><input type='text' name='advContent[ ]' /></td>"; <br>$str ="<td><input type='text' name='advSource[]' /></td>"; <br>$str ="<td><input type='text' name='advAuthor[]' /></td>"; <br>$str ="<td><input type= 'text' name='advPosition[]' /></td>"; <br>$str ="<td onClick='getDel(this)'><a href='#'>删除追加</a></td>"; <br>$str ="</tr>"; <BR>$("#addTr").append($str); <BR>}) ; <BR>}); <br><br>function getDel(k){ <BR>$(k).parent().remove(); <BR>} <BR></script> <br><br>------------------------------------------ ------------------------------------ <br>html 部分 <br><table align= center" border="1" cellpadding="0" cellpacing="0" width="100%"> <br><tr align="center"> <br><td>广告名</td> <br><td>广告画像</td> <br><td>广告内容</td> <br><td>广告来源</td> <br><td>广告者</td> <br><td>广告描写</td> <br><td align="center"><a href="#" id="getAtr">追加コンテンツ</a></td> <br></tr> <br><tbody id="addTr"> <br><tr align="center"> <br><td><input type="text" name="advTitle[]"/></td> <br><td><input type="file" name="img[]" /></td> <br><td><input type="text" name="advContent[]" /></td> <br><td><input type="text" name="advSource[]" /></td> <br><td><input type="text" name="advAuthor[]" /></td> <br><td><input type="text" name="advPosition[]" /></td> <br><td></td> <br></tr> <br></tbody> <br><tr align="center"> <br><tdcolspan="5"><input type="submit" value="全部添加" /></td> <br></tr> <br></table> <br> </div>