showing results for - "if text is present make div hide"
Catalina
21 Oct 2020
1<div class="test">
2  Pakket
3</div>
4<div class="test">
5  Handtekening
6</div>
7<div class="test">
8  Thuis
9</div>
Alejandro
19 Sep 2016
1let filteredOut = ['Handtekening', 'Thuis'];
2
3Array.from(document.querySelectorAll(".test")).forEach((elm) => {
4 if(filteredOut.includes(elm.textContent.trim())) elm.style.display = "none";
5});
6
Ronald
09 Aug 2016
1let divs = document.getElementsByClassName('test');
2
3for (let x = 0; x < divs.length; x++) {
4    let div = divs[x];
5    let content = div.innerHTML.trim();
6
7    if (content == 'Handtekening' || content == 'Thuis') {
8        div.style.display = 'none';
9    }
10}
11
Irene
11 Sep 2019
1var divs = document.querySelectorAll(".test");
2Array.from(divs).forEach(function(div) {
3  if (div.textContent.indexOf("Handtekening") >= 0 || div.textContent.indexOf("Thuis") >= 0) {
4    div.style.display = "none";
5  }
6});
Delfina
17 Feb 2018
1<div class="test">
2     Pakket
3</div>
4<div class="test">
5     Handtekening
6</div>
7<div class="test">
8     Thuis
9</div>
10