日期:2014-05-16 浏览次数:20376 次
<script type="text/javascript"> //添加作者 var current=1; function new_author() { old=current; current=current + 1; //设置插入的内容 str1="<div id=s" + current + "><li>作者" + current + "<input type=text maxlength=10 size=10 name=author/></li></div>"; strX="s"+ old; eval("document.all." + strX + ".insertAdjacentHTML(\"AfterEnd\",str1)"); } </script> </head> <body> <ul> <div id="s1"> <li id="del_li"> 作者1: <input type="text" maxlength="30" size="10" name="author" /> <button onclick="return new_author()">添加作者</button> <button onclick="return del_author()">删除作者</button> </li> </div> <li> 通信作者: <input type="text" maxlength="30" size="10" name="communication_author" /> </li> <ul> </body>
<script type="text/javascript"> //添加作者 var current=1; function new_author() { old=current; current=current + 1; //设置插入的内容 str1="<div id=s" + current + "><li>作者" + current + "<input type=text maxlength=10 size=10 name=author/></li></div>"; strX="s"+ old; eval("document.all." + strX + ".insertAdjacentHTML(\"AfterEnd\",str1)"); } </script> </head> <body> <ul> <li> 通信作者: <input type="text" maxlength="30" size="10" name="communication_author" /> </li> <div id="s1"> <li id="del_li"> 作者1: <input type="text" maxlength="30" size="10" name="author" /> <button onclick="return new_author()">添加作者</button> <button onclick="return del_author()">删除作者</button> </li> </div> <ul> </body>