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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T16:53:46+00:00 2026-06-10T16:53:46+00:00

So I want to be able to fetch a number from a table cell

  • 0

So I want to be able to fetch a number from a table cell and multiply it by an input on focusout, however the selector is grabbing all the table cells with the name front in the front. here is the code:

jquery

$(document).ready(function(){
    $(".percent").focusout(function(){
        var val2 = $(this).val();
        if (val2==="") {
            val2=0;
        }
        var crew2 = $(this).attr("name"),
            front = $(".front, td[name='front"+crew2+"']").text();
        console.log(crew2);
        console.log(front);
    });
});

html:

<tr>
    <td class='front' name='frontI210'>$176.00</td>
    <td><input type='text' class='percent' name='I210' style='' size='4' /></td>
    <td>=</td>
    <td class='total' id='I210'></td>
</tr>
<tr>
    <td class='front' name='frontI250'>$225.00</td>
    <td><input type='text' class='percent' name='I250' style='' size='4' /></td>
    <td>=</td>
    <td class='total' id='I250'></td>
</tr>

and console.log(front) is returning all the text of fronti210 and fronti250 as such:

$176.00$225.00

I want to only receive the information from the table cell that matches the input field name i just finished with, how do i do that?

  • 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-10T16:53:48+00:00Added an answer on June 10, 2026 at 4:53 pm

    $(".front, td[name='front"+crew2+"']") searchers for all elements with class front as well as all td elements with the name frontXXX. The comma is the multiple selector [docs].

    Either only search for td elements with that name:

    var front = $("td[name='front"+crew2+"']").text();
    

    or use DOM traversal:

    var front = $(this).closest('tr').children('.front').text();
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to be able to fetch results from mysql with a statement like
I want to be able to fetch a row from a list view and
I want to be able to use a wildcard in string::find and then fetch
I want to be able to hide a selector if it contains any data.
I want to use jCarousel and I want to be able to fetch the
Hey there! I'm not able to fetch a reliable monthly active users number of
I'm not able to fetch the access_token value from a QueryString in ASP.Net (C#).
i want to fetch Bus time and number etc using This in json or
I'm using LaTeX and BibTeX for an article, and I want to able to
Want to be able to provide a search interface for a collection of objects

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.