How can I check if any of the h2
elements match the text in h1
, ignoring case sensitivity? If a match is found, I want to add a class to the container Product-div
.
<div id="PageHeader">
<h1>Same text</h1>
</div>
<div class="Product">
<h2 class="ProductName">Product name 1</h2>
</div>
<div class="Product">
<h2 class="ProductName">Same text</h2>
</div>
<div class="Product">
<h2 class="ProductName">Product name 2</h2>
</div>