Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6531769
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T09:55:05+00:00 2026-05-25T09:55:05+00:00

I have some values in span s of class hi and hello , and

  • 0

I have some values in spans of class hi and hello, and they have some similarities. For example, h1_2 and h1_4 are present in both spans. How would I go about hiding the duplicates in hello (hi_2 and hi_4) on button click?

$('.click').live('click', function () {
    var val_sp = $(".hi b").map(function () {
        return $(this).text();
    }).toArray();
    //if (.hello == val_sp) {
        $('.hello').text(val_sp).hide()
    //};
});
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.4/jquery.min.js"></script>
<button class="click">Click</button><p>

<span class="hi">
 <b>hi_1</b>
 <b>hi_2</b>
 <b>hi_3</b>
 <b>hi_4</b>
</span>
    
<span class="hello">    
 <b>hello_1</b>
 <b>hi_2</b>
 <b>hello_3</b>
 <b>hi_4</b>
</span>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T09:55:06+00:00Added an answer on May 25, 2026 at 9:55 am

    I think you are looking for this (going by the title of your question).

    $(".click").click(function(){
       $(".hi b").each(function(){
          $(".hello b:contains("+$(this).text()+")").hide();
       });
    });
    

    Working demo

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have some HTML: <div id=bin> <span class=item1 selectMe>1</span> <span class=item2 selectMe>2</span> <span class=item3
I have some div <div id=editCatalogListItemHideMe> <div class=listItem> <table class=sectionTable> <tr> <td class=sectionLeft> <span
I have some values in a dataframe called 'values' ie: Sam Ned Ted Ann
I have some values in a configuration file (XML file) with some values like
In my C++ application, I have some values that act as codes to represent
I have some default values for testing my code, but for security reasons those
I have some financial values stored as text in a mysql db. the significance
I have some double values I want to convert to a string with this
I have some code that sets up a dictionary with some defualt values for
I have to transfer some values to be used as commands over the network,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.