简体   繁体   English

隐藏没有选择器的网站的一个div部分

[英]Hiding a single div section of a website with no selector

I am trying to hide a single snippet of code on my website as I upgraded to beta software and can't revert back without playing with my database. 当我升级到Beta版软件时,我试图在我的网站上隐藏一个代码片段,并且如果不使用我的数据库就无法还原。

I have attempted to use JQuery which I have achieved before though this div has no selector. 我尝试使用之前已实现的JQuery,尽管此div没有选择器。

I am a graphic designer though have a small knowledge of code. 我是一名平面设计师,虽然对代码有一点了解。

I also don't know how to find where the snippet has been input either nor can I just change the CSS. 我也不知道如何找到代码段的输入位置,也无法更改CSS。 You can see it as the beta license warning in the yellow box. 您可以在黄色框中将其视为Beta版许可证警告。

Any help will be appreciated, the website is (Removed to prevent abuse) 任何帮助将不胜感激,该网站为(已删除,以防止滥用)

Assuming this use case is actually legitimate and you have a valid license, you could just select child elements, for example to remove the beta warning: 假设此用例实际上是合法的,并且您具有有效的许可证,则可以选择子元素,例如删除beta警告:

$('#main-body div div div:first-child').css('display', 'none')

This selects the first child within several nested div elements, and hides it using the style display:none; 这将在多个嵌套的div元素中选择第一个孩子,并使用display:none;样式将其隐藏display:none;

document.getElementById('main-body').children[0].children[0].children[0].style.display = 'none';

When the above code is called the div will be hidden. 当上面的代码被调用时,div将被隐藏。

It basically gets the position of an element with a selector, and then goes from child to child and then finally hides the snippet of code. 它基本上通过选择器获取元素的位置,然后从一个子子到另一个子子,最后隐藏代码片段。

Hope this helps. 希望这可以帮助。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM