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 3788664
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T12:02:07+00:00 2026-05-19T12:02:07+00:00

How can I group all the following variables into using a sigle show() or

  • 0

How can I group all the following variables into using a sigle show() or hide() instead of individual call for each please? Thanks.

var alertsLink = "alertsLink";
var alertsLinkId = $j("#" + alertsLink);
var modifyLink = "modifySearch";
var events = $j("#eventsPanel");
var alerts = $j("#alertsPanel");
var results = $j("div.results");

if(id == eventsLink){
    events.show();
    alerts.hide();
    results.hide();
    eventsLinkId.hide();
    alertsLinkId.show();
  }else if(id == alertsLink){
    events.hide();
    alerts.show();
    results.hide();
    alertsLinkId.hide();
    eventsLinkId.show();
  }else if(id != modifyLink){
    events.hide();
    alerts.hide();
    results.show();
    alertsLinkId.show();
    eventsLinkId.show();
  }
}
  • 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-19T12:02:07+00:00Added an answer on May 19, 2026 at 12:02 pm

    If you would like to keep using your variables, rather than litter your code with lots of magic strings, then you can do:

    events.add(alertsLinkId).show();
    alerts.add(results).add(eventsLinkId).hide();
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I Group By all the deals in my database by store. How can I
I want DBSession.query(Article).group_by(Article.created.month).all() But this query can't using How do I do this using
I have the following SQLFiddle , i can group the results by time, count
How can i group by type and then get every id of each member
Scenario: I have the following structure; Group (parent) -> Item (child). A Group can
I want to execute the following: case 1: x = Group.all[0].people x.class => Array
With Javascript Webscript, I can get a group node with the following code: var
i'm working on a windows software which can display all the users, groups and
Trying to work with groupby so that I can group together files that were
How can I group a number of Dispatcher.Invoke and wait for one group to

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.