定位没有ID或CLASS的DIV [英] Target a DIV without an ID or CLASS

查看:398
本文介绍了定位没有ID或CLASS的DIV的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用jQuery,是否可以在没有选择器的情况下定位以下内容:

Using jQuery, is it possible to target the following without a selector:

<div style="background-color:#9AAEDB; padding:4px"></div>

如果是这样,怎么做,因为我基本上需要针对特定​​情况隐藏此div?

If so, how, as I basically need to hide this div for a particular scenario?

推荐答案

尝试

$("div[style='background-color:#9AAEDB; padding:4px']")

选择所需的div

这篇关于定位没有ID或CLASS的DIV的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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