For minor issues about parent () and siblings () in jQuery, jquerysiblings

Source: Internet
Author: User

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.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.