[HELP] How to hide html code if there is certain text on a web link?

AkhdaN

New member
Oct 8, 2020
17
2
3
I want to hide the html code if certain text is found on the web link using javascript. I am asking here because I have no basis in this field :)

Example:
when the web is accessed with this link: [?url=]
example.com/babiato.html?url=

I want to hide:
<div class='babiato-info'></div>

Thanks for reading my thread.
 

AkhdaN

New member
Oct 8, 2020
17
2
3
This should do it:

JavaScript:
var url = window.location.href;

if (url.indexOf("?url=") > -1)
{
    document.getElementsByClassName('babiato-info').style.display = 'none';
}

Thank you for your help, the method above did not work for me (I use blogger), I have been looking for various forms of code that I do not understand at all, and from the various codes that I have combined, I have reached the end. and the result is this:

JavaScript:
var url = window.location.href;

if (url.indexOf ("?url=")> -1)
{
document.querySelectorAll ("babiato-info") [0] .style.display = "none";
}

Maybe this looks simple for those of you who are professionals, but for me this is a miracle: D
 

About us

  • Our community has been around for many years and pride ourselves on offering unbiased, critical discussion among people of all different backgrounds. We are working every day to make sure our community is one of the best.

Quick Navigation

User Menu