When rendering a tree using UL LI, parents are not selectable but children are selectable by clicking on the checkbox. By default, the tree view is not expanded. I am attempting to implement a search feature where users can type a search criteria that is case-insensitive and the tree will expand to show matching results highlighted.
Although I have a JS function in place, it does not seem to return matching results or highlight them. Any suggestions would be highly appreciated.
HTML
<div id="errorCodes">
<ul class="treeview">
<li class="collapsable">
<div class="hitarea collapsable-hitarea"></div>
Pipettor Aspiration Dispense
<ul class="treeview" style="display: block;">
<li>
<input id="error150011" type="checkbox" value="150011"></input>
Unknown Error
</li>
<li class="expandable"></li>
JS Function
$("#search_tree").click(function () {
$("#errorCodes li").removeclass("collapsible").find("input").removeClass("highlighted");
//Search again
$("#errorCodes li input:Contains(" + $('#plugins4_q').val() + ")")
.addClass("highlighted").parents("li").addClass("collapsible");
});