For some reason, my function isn't firing in IE. It works in everything else, Safari, Firefox, Chrome, Opera, Edge. Can anyone see a specific issue with this? I think I've narrowed it down to this specific function. All other js seems to be working just fine. Thanks!
Uses Windows Server 2012 R2
this is the function in question:
function mySearch() {
var input = document.getElementById("Search");
var filter = input.value.toLowerCase();
var nodes = document.getElementsByClassName('connect-cat');
for (i = 0; i < nodes.length; i++) {
if (nodes[i].innerHTML.toLowerCase().includes(filter)) {
nodes[i].style.display = "block";
} else {
nodes[i].style.display = "none";
}
}
}
A bit of HTML used in the page, probably not necessary to diagnose this problem but trying to give as much as I can.
The search bar:
<div style="width:100%;margin-left:320px;">
<input type="text" id="Search" onkeyup="javascript:searching();" Placeholder="Please enter a search term..."> </input>
<input id="lawsonbox" type="checkbox" onchange="javascript:storefront();" style="position:absolute;width:15px;" ><font size="-3" style="margin-left:22px;">Highlight customizable Storefront products</font></input>
</div>
<br/><br/>
A couple of searchable products, html:
<div class="connect-cat" style="width:237px;height:350px;position:inherit;float:left;visibility: visible; display: block;">
<a href="CreateUserDocument.aspx?code=ADBUILDER8">
<img style="width:217px;" src="Custom/Themes/standard/Inserts/images/Ad_Print_Thumb.jpg"/>
<br/>
<div id="ptitle">
Ad - Print
<br/>
Customize on Storefront
</div>
<div id="pdesc">
Bring awareness and education
<br/>
to your audience.
</div>
</a>
<div style="display:none;">"print ad"ad print"experience more"experience more campaign"first choice campaign"home health collection"assisted living collection" post-acute rehabilitation services collection"ad"</div>
</div>
<div class="connect-cat" style="width:237px;height:350px;position:inherit;float:left;visibility: visible; display: block;">
<a href="Custom/Themes/standard/Inserts/Forms/1_1_15_Radio_TV sheet.xls">
<img class="sfclass" style="width:217px;" src="Custom/Themes/standard/Inserts/images/Ad_Radio_Thumb.jpg"/>
<br/>
<div id="ptitle">
Ad - Radio
<br/>
Download
</div>
<div id="pdesc">
Work with local station to produce.
<br/>
Must use Society-approved music bed.
</div>
</a>
<div style="display:none;">"radio ad"ad radio"experience more"experience more campaign"first choice campaign"ad"lawson"</div>
</div>