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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T16:16:00+00:00 2026-06-07T16:16:00+00:00

Ignoring how I got to this (I have rolled up various function calls to

  • 0

Ignoring how I got to this (I have rolled up various function calls to simplify the example), why do I get Object doesn’t support this property or method for the next() call of the 4th line below?

JQuery to string together all selected items label text:

var cbs = $('#controlId :checkbox');              // Get all checkboxes for the specified control id
var rest = cbs.slice(1);                          // Get all items except the first
var checked = rest.filter(':checked');            // Get all checked items
var result = checked.get(0).next('label').text(); // Error here getting first label text
for (var i = 1; i < checked.length; i++) {
            result = result + ', ' + checked.get(i).next('label').text();
}

HTML is generated by ASP.Net for a CheckBoxList and looks like:

<table id="controlId">
    <TBODY>
        <TR>
            <TD>
                <INPUT id=MainContent_DropDownCheckBoxList4_checkBoxList_0 value=ALL type=checkbox>
                <LABEL for=MainContent_DropDownCheckBoxList4_checkBoxList_0>All</LABEL>
            </TD>        
        </TR>
        <TR>
            <TD>
                <INPUT id=MainContent_DropDownCheckBoxList4_checkBoxList_1value=0 type=checkbox>
                <LABEL for=MainContent_DropDownCheckBoxList4_checkBoxList_1>Item 0</LABEL>
            </TD>
        </TR>
        <TR>
            <TD>
                <INPUT id=MainContent_DropDownCheckBoxList4_checkBoxList_2 type=checkbox>
                <LABEL for=MainContent_DropDownCheckBoxList4_checkBoxList_2>Item 1</LABEL>
            </TD>
        </TR>
    </TBODY>
</TABLE>

What is the correct way to get the label text for the checkboxes (using the above style of code)?

Please do not provide answers using selectors that start back at $(‘#controlId’)

  • 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-07T16:16:03+00:00Added an answer on June 7, 2026 at 4:16 pm

    That’s because get() returns a DOM element, not a jQuery object, and DOM elements do not support the next() method (jQuery objects do).

    You can use eq(0) or first() instead:

    var result = checked.first().next("label").text();
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Ignoring unsafe code, .NET cannot have memory leaks. I've read this endlessly from many
I've got this function to check my form: function checkFrm() { $.each($('select'), function() {
I have posted this question a while ago but got a partial answer to
I got a field in MYSQL called date_added. I want this to have the
Why does this empty the text immediately (ignoring delay)? $('#error_box_text').html('error text').delay(5000).html('') # jQuery 1.4
Based on this , how would you make ignoring parameters more succint? var m
I have a problem finding elements in XPath that's contains a certain string ignoring
I have this code I been working on but I'm having a hard time
this is a follow up to a question I got help with on here
So, i've got this Zend style frontcontroller set up. Basically it just redirects every

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.