Javascript delete div class

I gave you the code. just insert a div and that’s it. here di your screenshot

I’m talking about the block code in man codes

1 Like

oh man thank you so much for your time

1 Like

how to delete id

there are two divs but it only deletes one

document.getElementById(‘ID NAME’).style.display =‘none’;

I don’t know what you are doing. there are two options. 1. change the number [0] to [1] and see what happens. 2. find common div

I am trying

There are 2 of the same class, one is deleted and the other is not.

document.getElementsByClassName(‘d-flex-ch j-center mb-30’ [0].style.display =‘none’; 2X

document.getElementsByClassName(‘d-flex-ch j-center’)[0].style.display =‘none’; 2X

there are two for each class name
When I write the code, it only deletes one of the same class name.
I’m trying to delete ads

sorunu çözdüm
document.getElementsByClassName(‘d-flex-ch j-center’)[1].style.display =‘none’;
document.getElementsByClassName(‘d-flex-ch j-center’)[0].style.display =‘none’;

document.getElementsByClassName(‘d-flex-ch j-center mb-30’)[1].style.display =‘none’;
document.getElementsByClassName(‘d-flex-ch j-center mb-30’)[0].style.display =‘none’;

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.