For minor issues about parent () and siblings () in jQuery, jquerysiblings
I found a small problem today, but I don't know which one is running, but I think it's one of parent () and siblings.
I want to delete the selected content based on the input conditions as follows:
Demo:
<!DOCTYPE html>
There is no problem with the above:
The search condition is "COIDNG" (as shown below), which is displayed in the browser.
<script>$(function(){var coding = "CODING";var coding=coding.toUpperCase();$(".bolSearch").hide().filter(".bolSearch:contains("+coding+")").show().parent().parent().siblings().hide();})</script>
However, when I change the condition to WW11 (as shown below), according to my own understanding, the last two contents of WW11 should be displayed, but nothing can be found? What is the situation of Shenma?
<script>$(function(){var coding = "WW11";var coding=coding.toUpperCase();$(".bolSearch").hide().filter(".bolSearch:contains("+coding+")").show().parent().parent().siblings().hide();})</script>
Then, modify the Search Condition and change WW11 to WW11JM031. That is to say, this condition is unique and does not overlap.
The selected conditions are displayed again.
Then, I changed the condition WW11JM031 back to WW11.
$(".bolSearch").hide().filter(".bolSearch:contains("+coding+")").show().parent().parent().siblings().hide();
Change
$(".bolSearch").hide().filter(".bolSearch:contains("+coding+")").show();
All the content that I want to display is reached. Although the content meets the requirements, the display does not meet my requirements.
Finally, I made a detour and changed the style.
However, this stem is still not bypassed, and I don't know why I can only filter out the unique conditions.