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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T14:37:11+00:00 2026-05-27T14:37:11+00:00

I have a table and in every row I have a cell (Example, for

  • 0

I have a table and in every row I have a cell (Example, for first row: (id: ctl00_MainContent_grdSearch_i0_c5). I need to check if this cell has value 1 then disable its row (i.e. ctl00_MainContent_grdSearch_i0 in above case).

(id: ctl00_MainContent_grdSearch_itemsHolder)

row (id: ctl00_MainContent_grdSearch_i0)
row (id: ctl00_MainContent_grdSearch_i1)
row (id: ctl00_MainContent_grdSearch_i2)
  • 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-27T14:37:12+00:00Added an answer on May 27, 2026 at 2:37 pm

    You can use a single line to do this with the :contains() selector. This example is assuming you’re using div elements the way you described in comments.

    $( "#ctl00_MainContent_grdSearch_itemsHolder > div:contains(1)" )
        .attr( "disabled", "disabled");
    

    If your HTML is a more complicated, you might want to be more specific and use the this line instead:

    $( "#ctl00_MainContent_grdSearch_itemsHolder > div[id^=ctl00_MainContent_grdSearch_i]:contains(1)" )
        .attr( "disabled", "disabled");
    

    The first line finds any div under your itemsHolder div with the value of 1. The second line only finds div elements with the id starting with ctl00_MainContent_grdSearch_i that have the value of 1.

    In this demo I set background-color: gray; for the disabled rows so you could see them.

    Demo: http://jsfiddle.net/ThinkingStiff/MULSv/

    HTML:

    <div id="ctl00_MainContent_grdSearch_itemsHolder">
        <div id="ctl00_MainContent_grdSearch_i0">
            <div id="ctl00_MainContent_grdSearch_i0_c0" class="item">0</div>
            <div id="ctl00_MainContent_grdSearch_i0_c1" class="item">0</div>
            <div id="ctl00_MainContent_grdSearch_i0_c2" class="item">0</div>
        </div>
        <div id="ctl00_MainContent_grdSearch_i1">
            <div id="ctl00_MainContent_grdSearch_i1_c0" class="item">0</div>
            <div id="ctl00_MainContent_grdSearch_i1_c1" class="item">1</div>
            <div id="ctl00_MainContent_grdSearch_i1_c2" class="item">0</div>
        </div>
        <div id="ctl00_MainContent_grdSearch_i2">
            <div id="ctl00_MainContent_grdSearch_i2_c0" class="item">1</div>
            <div id="ctl00_MainContent_grdSearch_i2_c1" class="item">0</div>
            <div id="ctl00_MainContent_grdSearch_i2_c2" class="item">0</div>
        </div>
        <div id="ctl00_MainContent_grdSearch_i3">
            <div id="ctl00_MainContent_grdSearch_i3_c0" class="item">0</div>
            <div id="ctl00_MainContent_grdSearch_i3_c1" class="item">0</div>
            <div id="ctl00_MainContent_grdSearch_i3_c2" class="item">0</div>
        </div>
    </div>
    

    CSS:

    .item {
        display: inline-block; 
    }
    

    Script:

    $( "#ctl00_MainContent_grdSearch_itemsHolder > div:contains(1)" )
        .attr( "disabled", "disabled").css( "background-color", "gray" );
    

    Output:

    enter image description here

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

Sidebar

Related Questions

I have a table where every row has a unique id. The last table
In a html table I have in every row a cell with its own
i have a table.. where i try to show this image in every row.
I have an app that needs to check a database table every minute. The
Let's say I have a table that has user_id, date, score, and every user
We have a user table, every user has an unique email and username. We
I have a link ( anchor ) tag in a table cell on every
I have created a table where in a cell of each row a combo
I have a table in in which every row contains a form. see below
We have a database where every table name starts with WW. I want 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.