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

  • Home
  • SEARCH
  • 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 8625655
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T07:50:36+00:00 2026-06-12T07:50:36+00:00

The initial part of my code is working. It loads the – sign and

  • 0

The initial part of my code is working. It loads the - sign and then changes to a + sign when clicked. Or it either loads a multiple + signs if needed. Either way, the first initial load is fine. The problem is on the click event. It simply doesn’t work.

$(document).ready(function() {
    if ($('.user-email').length == 1) {
        $('.user-email .section-icon').toggleClass('open');
        $('.section-icon').text('-');
    } else if ($('.user-email').length > 1) {
        $('.section-icon').text('+');
    }

    $('.user-email-text').click(function(event) {
        event.preventDefault();
        if ($(".section-icon:contains('-')")) {
            $('.section-icon').text('+');
        } else if ($(".section-icon:contains('+')")) {
            $('.section-icon').text('-');
        }
        $(this).parent().next().toggle();
        $(this).siblings('.section-icon').toggleClass('open');
        return false;
    });
});​

My fiddle is here http://jsfiddle.net/6QW2K/

  • 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-06-12T07:50:37+00:00Added an answer on June 12, 2026 at 7:50 am
    if ($(".section-icon:contains('-')")) {
    

    Always evaluates to true, you can use length property:

    if ($(".section-icon:contains('-')").length) {
    

    http://jsfiddle.net/f2GZG/

    You can also use text method instead of using :contains selector:

    $('.section-icon').text(function(i, cur){
       return cur === '+' ? '-' : '+'
    }) 
    

    http://jsfiddle.net/UaGrt/

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

Sidebar

Related Questions

I am working on a drop down list. The initial HTML code is as
The Problem I'm working on a problem that involves sharding. As part of the
We had a piece of code in C in one class where we needed
Consider this simplified view of some code with which I'm working: @Stateless(...) @Remote(...) @TransactionAttribute(TransactionAttributeType.MANDATORY)
my question is this: I have HTML code in multiple pages, on each of
I've code that, depending on the selected item in a drop-down, loads some further
Initial Question Yesterday i read about ECMAScript 5 Object.create() And I wanted to start
Initial tests indicate that GDI+ (writing in VB.NET) is not fast enough for my
My initial task was to find a segmenter for Windows that will split a
My initial question was here and was related to the postgres backend. Postgres subquery,

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.