Within my website layout, I have a div that is dynamically included using PHP. This div is inserted in two different locations, each inside its own parent div.
<div id="parent_div">
<div id="contact_details_div" class="contact_details_div sameheight">
<h3>Some Text</h3>
Some additional Text
</div>
<div id="contact_div" class="contact_div sameheight">
Even more text
</div>
</div>
The parent div can have one of two unique IDs.
I am looking for a way, either through jQuery or vanilla Javascript, to remove the 'sameheight' class when the parent div has a specific ID. The following code successfully removes the class but from both parent divs:
$( "#contact_details_div" ).removeClass( "sameheight" )
$( "#contact_div" ).removeClass( "sameheight" )
I believe I need an IF statement to make this conditional, however, I am uncertain about how to structure it.