使用jQuery删除LI [英] Remove LI using jQuery

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

问题描述

我有下面的代码,我需要删除开放的UL和LI以及关闭LI和UL并保持内部UL。


我已经尝试了一切我可以想到但是不是jQuery的专家让我失望,任何帮助都非常感激。

展开 | 选择 | Wrap | 行号

解决方案

你需要做的是(在玩使用DOM时)

- 复制内部< ul>

- 替换外部< ul>使用复制的节点


虽然不要问我如何使用jQuery


如果除了jQuery之外还有其他任何想法所有的方法都告诉。


假设我可以挂钩(在jQuery中会更容易)

展开 | 选择 | Wrap | 行号

I have the code below, I need to remove the opening UL and LI and the closing LI and UL and just keep the inner UL.

I''ve tried the everything I can think of but not being an expert in jQuery is letting me down, any help much appreciated.

Expand|Select|Wrap|Line Numbers

解决方案

what you would need to do is (at laest when using DOM)
- copy the inner <ul>
- replace the outer <ul> with the copied node

although don?t ask me how to do that with jQuery


Well if you have any other ideas apart from jQuery by all means do tell.


assuming there are ids I can hook on (that would be easier in jQuery)

Expand|Select|Wrap|Line Numbers


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

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