js代码实现填写简历时“添加项目经历”功能
2012-12-06 13:56
691 查看
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <title> New Document </title> <meta http-equiv="Content-Type" content="text/html; charset=GBK"> <meta name="Generator" content="EditPlus"> <meta name="Author" content=""> <meta name="Keywords" content=""> <meta name="Description" content=""> <script> var index=0; function addedu(){ //alert(index); var edu=document.getElementById("education"); var current = document.getElementById("current_edu"); current.removeAttribute("id"); //var count = current.childNodes.length; index++; var button = document.getElementById("add_but"); var new_button = button.cloneNode(); //alert(index+":"+count); current.removeChild(button); //var another = first.cloneNode(); var another = document.createElement("div"); //var child_text1 = document.createTextNode(""); var child_time = document.createElement("input"); var time_text = document.createTextNode("时间"); child_time.setAttribute("type","text"); child_time.setAttribute("name","time"+index); var child_name=document.createElement("input"); var name_text = document.createTextNode("学校"); child_name.setAttribute("type","text"); child_name.setAttribute("name","edu"+index); var child_br = document.createElement("br"); another.appendChild(time_text); another.appendChild(child_time); another.appendChild(name_text); another.appendChild(child_name); another.appendChild(new_button); another.appendChild(child_br); another.setAttribute("id","current_edu"); edu.appendChild(another); } </script> </head> <body> <div id="education"> <div id="current_edu"> 时间<input type="text" name="time0"/>学校<input type="text" name="edu0"/> <input type="button" value="+" id="add_but" onclick="addedu();"/> <br/> </div> </div> </body> </html>
相关文章推荐
- 【SSH网上商城项目实战09】添加和更新商品类别功能的实现
- 【SSH网上商城项目实战12】添加和更新商品功能的实现
- C项目开发—通讯录(二) 初始化、查看、添加功能实现
- Java web项目01 停车管理系统实现添加用户信息功能(四)
- 框架 day51 BOS项目练习(定区添加及查询,Hessian入门,基于hessian实现定区关联客户功能)
- fastdfs 新添加一个项目的图片目录 实现独立的上传下载功能
- Maven项目中添加log4j.properties实现日志功能工具
- 商城项目实战24:实现添加商品功能
- Vue项目中添加锁屏功能实现思路
- java Web项目实践之7 添加功能、精确查询功能的设计及实现
- 【SSH网上商城项目实战12】添加和更新商品功能的实现
- 【SSH网上商城项目实战09】添加和更新商品类别功能的实现
- 【SSH网上商城项目实战09】添加和更新商品类别功能的实现
- SSH框架网上商城项目第9战之添加和更新商品类别功能实现
- 【SSH网上商城项目实战12】添加和更新商品功能的实现
- 【SSH网上商城项目实战09】添加和更新商品类别功能的实现
- BOS项目练习(定区添加及查询,Hessian入门,基于hessian实现定区关联客户功能)
- 直播项目,在线聊天功能--socket实现客户端和服务器端通讯的简单案例
- 本文实例讲述了AngularJS+bootstrap实现动态选择商品功能。分享给大家供大家参考,具体如下: 项目中后台一个商品库,新建活动时动态选择所需商品
- 不用ajax也能实现的功能!单击添加新行时可以删除这一行信息的源码