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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T00:42:52+00:00 2026-06-16T00:42:52+00:00

If I get a recordset from a mySQL database of 10 names, I can

  • 0

If I get a recordset from a mySQL database of 10 names, I can use jquery to filter those by first letter. However, if I had a link on a page for every letter of the alphabet, and wanted to grey out the ones that did not have any “results”, how would I do this?

Here is how I am currently filtering the results:

$(document).ready(function() {
    function filterResults(letter){
        $('p').hide();
        $('p').filter(function() {
            return $(this).text().charAt(0).toUpperCase() === letter;
        }).show();
    };
    filterResults('A');
    $('a').on('click',function(){
        var letter = $(this).html();            
        filterResults(letter);        
    });
});

Fiddle of the example is here:
http://jsfiddle.net/livinzlife/8UE6m/

What I would like is for all letters unaccounted for to be grey. I have no idea how to select those that are unaccounted for though.

  • 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-16T00:42:53+00:00Added an answer on June 16, 2026 at 12:42 am
    var $p = $('p');
    $('a').addClass(function(){
        var a = this.textContent;
        return $p.filter(function(){
           return this.textContent.charAt(0) === a
        }).length ? 'green' : 'grey';
    });
    

    http://jsfiddle.net/zLxKU/

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

Sidebar

Related Questions

php 5.2.5 I wrote the function to get modules by courseid from MySQL database.
I randomly get a row from a mysql-database using php (ugly random, I know).
Can any one help me get the total # of records from a database
I have a table that get its rows from a MYSQL database <table id=table1>
I have to get records from my MySQL DB where: sentto = $username OR
How can I get specific number of records from nhibernate like 10 or 15
I am trying to get all the prime(row) numbered records from my table.Can someone
I have some tables in a MySQL database to represent records from a sensor.
I'm trying to port a database from MySQL to PostgreSQL. I've rebuilt the schema
I am fetching records from MySQL database using Java (JDBC). I have tables -

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.