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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T11:15:37+00:00 2026-05-30T11:15:37+00:00

I am trying to build a drop-down menu that will show a row to

  • 0

I am trying to build a drop-down menu that will show a row to the side of it when you hover over one of the cells with the mouse. I’m really new with using the DOM, and javascript as well.

The problem I’m running into is that the array I have created doesn’t seem to access what I thought it should. Is it just my syntax, or do I need to approach this differently? Here is my code:

window.onload = function () {
    var tableID = "strokerKitMenu";
    var table = document.getElementById(tableID);
    var tableRows = table.getElementsByTagName("tr");
    var tableCell = [];
    var counter = 0;
    for (i = 0; i < tableRows.length; i++) {
        tableCell[i] = new Array();
        tableCell[i].push(tableRows[i].getElementsByTagName("td"));
    }

    for (i = 0; i < tableCell.length; i++) {
        tableCell[0, i].style.display = "block"; //This doesn't compile
        alert(tableCell[0, i].Text); //This comes back "undefined"
        for (j = 1; j < tableCell[i].length; j++) //I haven't even tested this part yet
        {
            tableCell[i][j].onmouseover = function showCell() {
                tableCell[i][j + 1].style.display = "block";
            }
            tableCell[i][j].onmouseout = function hideCell() {
                this.style.display = "none";
            }
        } //end inner for loop
    } //end outer for loop
}
  • 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-30T11:15:38+00:00Added an answer on May 30, 2026 at 11:15 am

    tableCell[i].push.apply(tableCell[i], tableRows[i].getElementsByTagName("td"));

    You don’t want to push the single array in. You want to push all the elements in. Otherwise you would have to access them as tableCell[i][0][j]

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

Sidebar

Related Questions

I'm trying to build drop down options on mouse over and on click. The
I'm trying to build a horizontal drop down menu with CSS. But the submenu
I am trying to build a basic drop down menu with jquery. I have
I'm trying to build a css drop down menu. I have a div #category_list
I'm trying to build an AutoComplete DropDown List that will work on a Mobile
I'm trying to build a really basic program that will alternate between two pictures
I am trying to build a CSS dropdown menu. The problem is that all
I am trying to build a simple drop down list for my MVC application.
I am trying to write an MVC webpage that has two drop down lists.
I'm trying to build my own custom dropdown menu that should remember it's vertical

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.