87,910
社区成员
发帖
与我相关
我的任务
分享
<html>
<body>
<div id="inp_id"></div>
hello world
<script type="text/javascript">
function addone(){
var newbr = document.createElement("br");
var newinp = document.getElementById("inp_id");
newinp.appendChild(newbr);
}
function removeone(){
}
</script>
</body>
</html>
var brList = document.all("inp_id").getElementsByTagName("br");
var brlen = brList.length;
newinp.removeChild(brList[(brlen-1)]);
var newinp = document.getElementById("inp_id");
var brList = newinp.getElementsByTagName("br");
for(var i=0; i<brList.length; ++i)
newinp.removeChild(brList[i]);