码迷,mamicode.com
首页 > 其他好文 > 详细

留言板

时间:2016-05-23 09:06:56      阅读:168      评论:0      收藏:0      [点我收藏+]

标签:

<!DOCTYPE html> <html> <head lang="en">     <meta charset="UTF-8">     <title></title>     <style>         #a{width: 90%;height: 400px;             overflow: scroll;         border: 1px black solid;             position: relative;         }         li{margin-top: 10px;overflow: hidden}         #huifu{position: absolute;right: 20px;bottom:20px}         p{margin-left: 30px}     </style> </head> <body> <div class="all"> <ul id="a">     <li id="b">天猫<br/>          &nbsp;&nbsp;&nbsp;如果你有意见和建议求留言</li>     <li id="huifu">留言</li> </ul>
</div>
</body> <script type="text/javascript"> var a=document.getElementById("a"); var b=document.getElementById("b"); var c=document.createElement("textarea"); var d=document.createElement("input"); var e=document.createElement("input"); e.setAttribute("type","text"); d.setAttribute("type","submit"); huifu.onclick=function(){ a.appendChild(e); a.appendChild(c); a.appendChild(d); e.style.width=""; c.style.width="98%"; d.style.width="40px"; e.style.marginTop="30px"; c.value=""; e.value=""; }; d.onclick=function(){ var f= c.value; var w= e.value;
var time2=document.createElement("small"); var time3=document.createTextNode(Date()); var h=document.createElement("p"); var w2=document.createElement("li"); var w3=document.createElement("small");
var i=document.createTextNode(f); var w1=document.createTextNode(w); time2.style.float="right"; time2.appendChild(time3); w2.appendChild(w1); h.appendChild(i); h.appendChild(time2); a.appendChild(w2); a.appendChild(h);
a.removeChild(c); a.removeChild(d); a.removeChild(e);

}
</script> </html>

留言板

标签:

原文地址:http://www.cnblogs.com/dugufeiyang/p/5518661.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!