0

What I need to do is load only the second table (Or tbody) element (Un-named and has no class), from the div named megaContent. What I'm planning to do is have the browser go to the page, then load this JS and have it display that part only.

0

1 Answer 1

1

it is not perfectly clear what do you mean by "LOAD only the table". if you'd like to DISPLAY only the table and you don't know how to reach it since it does not have any class or id, you could do something like this:

var tbls = document.getElementById("megaContent").getElementsByTagName("table");
var tbl = tbls[0]; // [0] if the desired table is the first table in that div, [1] if second etc.
tbl.style.display="block"; //or "table", or whatever you'd like to do with that table.

hope this helps.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.