English 中文(简体)
从一年级移除分子(无id)
原标题:Remove ul(no id for ul) elements from a class - Jquery
  • 时间:2012-04-22 00:28:39
  •  标签:
  • jquery

我试图开发一条从一个地点搬走的 bar子,但迄今为止,我把ma子赶走,去掉这个阶级本身,但我不能在四处删除内容。 我可以去除整个现场的所有分子,但我只需要清除与“禁运”四类和内ul相关的所有具体内容,然后才有身份证,因此,我可以由JQuery跟踪。 我如何去除这些内容?

<div class="bar"> <ul>
                    <a href="..." onclick=""/>
    <span class="title">Title 1</span>
    </a>

     <a href="..." onclick=""/>
    <span class="title">Title 2</span>
    </a></ul></div>

这是我迄今为止在基奎里所做的事情。

$(".bar").removeClass( bar );

我已尝试过这一点,但是,它删除了整个网页上的所有UL分子,我不想这样说。

$( ul:not(:first):not(:last) ).remove();
最佳回答

希望:

$(".bar ul").remove();

rel=“nofollow>docs

Description: Selects all elements that are descendants of a given ancestor.

问题回答

这一工作应当:

$(".bar > ul").remove();

删除;同样有效。





相关问题
getGridParam is not a function

The HTML: <a href="javascript:void(0)" id="m1">Get Selected id s</a> The Function: jQuery("#m1").click( function() { var s; s = jQuery("#list4").getGridParam( selarrrow )...

selected text in iframe

How to get a selected text inside a iframe. I my page i m having a iframe which is editable true. So how can i get the selected text in that iframe.

jQuery cycle page with links

I am using the cycle plugin with pager functionality like this : $j( #homebox ) .cycle({ fx: fade , speed: fast , timeout: 9000, pager: #home-thumbs , ...

jquery ui dialog opens only once

I have a button that opens a dialog when clicked. The dialog displays a div that was hidden After I close the dialog by clicking the X icon, the dialog can t be opened again.

jConfirm with this existing code

I need help to use jConfirm with this existing code (php & Jquery & jAlert). function logout() { if (confirm("Do you really want to logout?")) window.location.href = "logout.php"; } ...

Wrap text after particular symbol with jQuery

What I m trying to do, is wrap text into div inside ll tag. It wouldn t be a problem, but I need to wrap text that appears particularly after "-" (minus) including "minus" itself. This is my html: &...

热门标签