Site logo

Archived topic

Hide/Show an element class based on another element class

3 replies · Started by Marketers Company SRL on September 6, 2018

Viewing posts 1–4 of 4

You could try this:

var someElement = document.querySelector( '.some-element' );

if ( someElement ) {
    document.querySelector( '.another-element' ).style.display = 'none';
}

Great Tom,
works perfectly!

Awesome :)

This archived topic is closed to new replies.