In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/01 Report--
这篇文章主要为大家展示了"js如何实现微博发布小功能",内容简而易懂,条理清晰,希望能够帮助大家解决疑惑,下面让小编带领大家一起研究并学习一下"js如何实现微博发布小功能"这篇文章吧。
微博发布功能,可发布可删除。样式没设置忽略,主要知识点及注意点:
1、动态添加节点标签。
2、内容为空时不能发布。
3、新发布的内容要在上面。
4、内容删除要同时删除掉节点。
5、为保持样式输入框要设置为不可拖拽。
Document * {margin: 0;padding: 0;} .box{ border: 1px solid #000; width: 600px; height: auto; margin:100px auto; padding:30px 0; } textarea{ width: 450px; resize:none; margin-left: 20px; } ul li{ width: 450px; list-style: none; border-bottom: 1px dotted #ccc; margin-left:20px; line-height: 30px; color: #333; } ul li a{ float: right; font-size: 12px; } // 方法1 _window.onload = function () { var box = document.getElementById("box"); var boys=box.children; var ul = document.createElement("ul"); box.appendChild(ul); boys[2].onclick = function (){ if(boys[1].value==""){ alert("输入不能为空"); return; } var newli= document.createElement("li"); newli[xss_clean]=boys[1].value+"删除"; boys[1].value =""; var lis=ul.children; if(lis.length==0){ul.appendChild(newli);}else{ ul.insertBefore(newli, lis[0]); } var as=document.getElementsByTagName("a"); for (var i=0;i
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.