使用jquery更新UL LI [英] Update UL LI using jquery

查看:107
本文介绍了使用jquery更新UL LI的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在列表中有一个项目,然后当我点击+链接列表更新到我的其他列表时我想要。我试图用jquery做这个,但我没有结果。哪里可能是错误?





I have a items in a list and i want then when i click in "+links" the list update to my other list. Im trying to do this with jquery but im not having the results. Where might be the error?


<footer id="footer-container">
      <section id="footer1">

          <ul id="showfirst">
             <h1>Links</h1>
             <li><a href="#">Link 1</a></li>
             <li><a href="#">Link 2</a></li>
             <li><a href="#">Link 3</a></li>
             <li><a href="#">Link 4</a></li>
             <li><a href="# id="next"> + links </a></li>
          </ul>

          <ul id="showsecond">
             <li><a href="#">Link 5</a></li>
             <li><a href="#">Link 6</a></li>
             <li><a href="#">Link 7</a></li>
             <li><a href="#">Link 8</a></li>
             <li><a href="#">+ links</a></li>
          </ul>

       </section>
   </footer>







<script type="text/javascript">
    $('#next).click(function{
  
    $('#showsecond').show();

});
</script>

推荐答案

' #next).click(function {
('#next).click(function{


(' #showsecond ' )。show();

});
< / script>


正如我所说,除了可见性之外,您不会尝试更改任何内容。所有这一切的目的仍不清楚。要更改内容,您需要......进行更改。这里解释了一切:

http://api.jquery.com/category/manipulation [ ^ ]。



-SA
As I say, you are not trying to change anything except visibility. The purpose of all this remains unclear. To change content, you need… change it. Everything is explained here:
http://api.jquery.com/category/manipulation[^].

—SA


这篇关于使用jquery更新UL LI的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆