I have a tag on my site that I want to remove. It seems that one of the features on my site is adding the tag. I was wondering if I could use CSS to remove the tag? The tag looks like this.
<p data-f-id="pbf" style="text-align: center; font-size: 14px; margin-top: 30px; opacity: 0.65; font-family: sans-serif;">…</p>
I am just not sure how to remove it because it doesn't have an ID or class.
CodePudding user response:
Just write this javascript in someplace on the web and done.
This code will remove first p[data-f-id="pbf"]
element.
document.querySelectorAll('p[data-f-id="pbf"]')[0].remove();
Or if you have more than one element you can remove all of them:
let pbfelements = document.querySelectorAll('p[data-f-id="pbf"]');
pbfelements.forEach(function(elem) {
elem.remove();
});
querySelectorAll() function Javascript
CodePudding user response:
You can do it by CSS attr selector.
Please check CSS attr selector.
p[data-f-id="pbf"] {
display: none !important;
}
<p data-f-id="pbf" style="text-align: center; font-size: 14px; margin-top: 30px; opacity: 0.65; font-family: sans-serif;">I won't appear.</p>
<iframe name="sif1" sandbox="allow-forms allow-modals allow-scripts" frameborder="0"></iframe>