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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T18:24:26+00:00 2026-05-27T18:24:26+00:00

My html: <div id=dvUser> <table id=tblUser > <tbody> <tr> <td> <input class=sfCheckBox type=checkbox title=view

  • 0

My html:

<div id="dvUser">
<table id="tblUser" >
<tbody>
<tr>
<td>
<input class="sfCheckBox" type="checkbox" title="view" checked="checked">
</td>
</tr>
<tr>
<td>
<input class="sfCheckBox" type="checkbox" title="edit">
</td>
</tr>
</tbody>
</table>
</div>

and Jquery:

$('#spnBtnSave').live("click", function() {
  var checks = $( #dvUser tr:gt(0)').find('input.sfCheckbox:checked');
  $.each(checks, function(index, item) {
      if ($(this).attr("checked")) {
          alert($(this).closest('table').attr('id'));
          alert("test");
      }
});

alert return blank.Unable to return table attribute id.What is my mistake.Thanks.

  • 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-27T18:24:26+00:00Added an answer on May 27, 2026 at 6:24 pm

    These are the things I did, and here is a working jsFiddle:
    – The $.each loop, can be called on a set of objects, so you don’t have to make a separate array.
    – I fixed capitalization in input.sfCheckBox:checked, previously it was Checkbox and the html example uses the class CheckBox
    – I merged your selectors for the checkboxes to this $( '#dvUser input.sfCheckBox:checked')
    – You only select checked inputs, so you don’t need to test if they are checked again in the each loop

    $('#spnBtnSave').live("click", function() {
      $( '#dvUser input.sfCheckBox:checked').each(function() {
        alert($(this).parents('table').attr('id'));
        alert("test");
      });
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Suppose the following HTML div container <div id=container> <form> <div> <label class=error>Name</label> <input type=text
$(function() { var div = $('div'); $('input').click(function() { if($(this).is(':checked')) { div.html(div.text() += 49); }
I have this html div tag defined: <div style=height:100px; width:100px class=total-title> first text </div>
here is link to an example: http://techchorus.net/demos/jquery/hiding-input-elements-in-a-div.html It actally disables few elements on click
$(this).parent().parent() .children(this.attr(tagName).toLowerCase()) .css(background-color, yellow); xpath: /html/body/div/table/tr/td/b/a $(this).tagName is Anchor <a> the problem with this
$('div.box').html(hello) puts the word hello inside all my div's of class 'box'. They all
My HTML looks like and js looks like this: <div class=container></div> var html =
I have a simle html div with a variable number of input checkboxes and
I have html div class formated accordingly.... <div class=latest-media-images> <div class=hdr-article>LATEST IMAGES</div> <a class=lnk-thumb
I have a HTML DIV element: <div class=obj height=this is attr 1 rel=this is

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.