删除具有多个类但没有ID的元素 [英] Remove Element with multiple Class without ID

查看:101
本文介绍了删除具有多个类但没有ID的元素的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

曾被Google谷歌搜索,找不到答案.此后,我该如何删除没有id的特定div和child(它是由WijGrid生成的)

Been Googling and couldn't find the answer. How do I go about removing THIS specific div and child after that, without an id (it was generated by WijGrid)

<div class="wijmo-wijsuperpanel-vbar-buttontop ui-state-default ui-corner-tr">
    <span class="ui-icon ui-icon-triangle-1-n"></span>
</div>

我尝试了,但是没有去

$('.wijmo-wijsuperpanel-vbar-buttontop .ui-state-default .ui-corner-tr').remove();

提前谢谢!

推荐答案

只需删除选择器中的空格:

Just remove the spaces in your selector:

$('.wijmo-wijsuperpanel-vbar-buttontop.ui-state-default.ui-corner-tr').remove();

使用空格,它将在wijmo-wijsuperpanel-vbar-buttontop类的元素内选择ui-state-default类的元素内选择具有ui-corner-tr类的元素.

With the spaces, it would select elements with ui-corner-tr class inside an element with ui-state-default class inside an element with wijmo-wijsuperpanel-vbar-buttontop class.

这篇关于删除具有多个类但没有ID的元素的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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