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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T11:37:39+00:00 2026-06-08T11:37:39+00:00

I am wondering what is the correct way to read values from a html

  • 0

I am wondering what is the correct way to read values from a html table in jQuery?
Here is my HTML code:

<table>
<tr>
<td id="final">[['1.48E+02', '1.79E+03', '2.16E+04', '2.61E+05', '3.15E+06', '3.81E+07', '4.60E+08', '5.56E+09', '6.72E+10', '8.12E+11'], ['1.20E+01', '1.48E+02', '1.79E+03', '2.16E+04', '2.61E+05', '3.15E+06', '3.81E+07', '4.60E+08', '5.56E+09', '6.72E+10']]</td>
</tr>
</table>

jquery selector:

var s1 = $.parseJSON($('#final').text());
// I have tried .val(), .html(), but those did not work.

However, if my HTML is written in this way, then the jquery code works:

<table>
<tr>
<td id="final">[[148.0, 1788.0, 21604.0, 261036.0, 3154036.0, 38109468.0, 460467652.0, 5563721292.0, 67225123156.0, 812265199164.0], [12.0, 148.0, 1788.0, 21604.0, 261036.0, 3154036.0, 38109468.0, 460467652.0, 5563721292.0, 67225123156.0]]</td>
</tr>
</table>

Can anyone help me with my jquery code for the first HTML situation? 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-06-08T11:37:40+00:00Added an answer on June 8, 2026 at 11:37 am

    You could just try using eval:

    var s1 = eval($('#final').text());
    

    JsFiddle Example

    I find eval isn’t too bad as long as you control the content that you put in the eval.

    The Eval Function.

    Oh and also, please note if you don’t wanna use that, remember than in JSON you can’t use the single quote or it wont parse. You can always check for valid JSON here: http://jsonformatter.curiousconcept.com. It will tell you all the errors in your JSON

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

Sidebar

Related Questions

I was just wondering about the correct way to return a reader from a
I was wondering what the correct way of issuing an asynchronous read operation on
I'm wondering what the correct way is to pass on an exception from one
Example: I am wondering what would be the correct way to code an un-ordered
I was wondering what the correct-way is when using a Linq to Sql-model in
I am wondering if there is a correct way to implement the anchor tag
I was wondering if the codes below are the correct way to check for
Wondering what the best / good way of doing this would be in jQuery.
Wondering if there is any way to get the lambda expressions that result from
I have got this read file code from microsoft @C:\Users\computing\Documents\mikec\assignment2\task_2.txt That works fine when

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.