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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T09:45:43+00:00 2026-06-04T09:45:43+00:00

I saw an example here and checked how it works but i got an

  • 0

I saw an example here and checked how it works but i got an error – (See Title)

Do you know why?

This is the code (Its similar to the link):

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<!--

  Created using /
  Source can be edited via /eyeyu/edit

-->
<head>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script>
<title>Sandbox</title>
<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
<style type="text/css" media="screen">
body { background-color: #000; font: 16px Helvetica, Arial; color: #fff; }
</style>
</head>
<body>
  <table border="1">
    <tr><td>1</td><td>2</td><td>3</td></tr>
    <tr><td>4</td><td>5</td><td>6</td></tr>
    <tr><td>7</td><td>8</td><td>9</td></tr>
  <tbody>
</table>
<script>
$('td').click(function(){
    var colIndex = $(this).parent().children().index($(this));
    var rowIndex = $(this).parent().parent().children().index($(this).parent());
    alert('Row: ' + rowIndex + ', Column: ' + colIndex);
});
</script>
</body>
</html>
  • 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-04T09:45:46+00:00Added an answer on June 4, 2026 at 9:45 am

    Your code works just fine!

    The problem by all the tests performed may come by the absence of the jQuery library,
    see the live simulation link and print-screen.

    Also, this working Fiddle Example!


    As a side note:

    • You are missing a closing tag for tbody and have the opening tag
      out of order:

    UPDATE YOUR HTML TO THIS

    <table border="1">
      <tbody>
        <tr><td>1</td><td>2</td><td>3</td></tr>
        <tr><td>4</td><td>5</td><td>6</td></tr>
        <tr><td>7</td><td>8</td><td>9</td></tr>
      </tbody>
    </table>
    
    • Your script tag is missing the type:

    UPDATE YOUR TAG TO THIS

    <script type="text/javascript">...</script>
    

    AND

    <script src="path_to_jquery.js" type="text/javascript"></script>
    

    EDITED :: To better consolidate this answer

    1. Link to live HTML file working!
    2. Link to live HTML file without the jQuery loaded, thus causing the error!
    3. Print-screen for those who don’t want to follow the link:

    enter image description here

    Note:
    As stated by cliffs of insanity on the comments, .ready() is not needed on this case since the jQuery code is located below the elements it selects!

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

Sidebar

Related Questions

I saw this C# using statement in a code example: using StringFormat=System.Drawing.StringFormat; What's that
Here is code i saw in a C program , i knew this piece
I'm making a javascript/canvas game and I saw this example on CSS Tricks. Here's
i saw a example for login form same blow code class Form_Login extends Zend_Form
Once, I saw an example like this: var a, x, y; var r =
I saw this in a random doxygen example for C#, and all attempts at
im looking for an example script. I saw one yesterday but for the life
I saw the following example disccussed here previously, where the goal was to return
I'm trying to use a raphael.js example located here: http://raphaeljs.com/pie.html but I want to
I saw in an earlier post here on stackoverflow a example on many 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.