I am seeking to conceal all div elements that contain the href attribute as shown below:
<div style="margin-left:36.847599164927%;margin-top:-30.27139874739%;width:19.72860125261%"><a href="//www.exemple.com/item/detail/4000105891117.html" target="_blank" rel="noopener"><img src="//ae01.alicdn.com/kf/He3f2750635b24a4d9e30666180dfacc89.png"></a></div>
I also want to hide the div with an image that has the structure below:
<div><img src="//ae01.alicdn.com/kf/Haabbc1065ea449668ced4bf88021f4aea.png"><p></p>
Here is the large text containing the divs that I want to hide, leaving the rest of the divs visible:
<div class="woocommerce-Tabs-panel woocommerce-Tabs-panel--description panel entry-content wc-tab" id="tab-description" role="tabpanel" aria-labelledby="tab-title-description" style="">
<h2>Description</h2>
<div>
<div>
[...]
<strong style="font-family: times new roman , times , serif;color: #ff0000;font-size: 18.0px"><span style="color: #000000"><span style="font-family: times new roman , times , serif"><span style="font-size: 36.0px">Satisfaction —— Give us 5 stars .</span></span></span></strong>
[...]
I attempted the following JavaScript code, but it hides all div elements:
window.addEventListener=()=>{
var elem=document.querySelectorAll("div");
var i;
for(i=0;i<elem.length;i++){
var obj=elem[i];
if(obj.innerHTML.toString().includes('href')){
obj.style.display="none";
}
}
}