Reputation: 5
I have a page in active tab. I need to find in this page a table:
<table width="100%" cellspacing="0" cellpadding="0" border="0" class="details">
grab it until next </table>
-tag,
and use it (to paste it in a new tab, popup, or just in "alert").
Upvotes: 0
Views: 454
Reputation: 3473
I wouldn't include jQuery for such an easy task.
var table = document.getElememtsByTagName("table")[0]; //if it is the first or only table, you could change 0 to any other number if the table always is at the same position
or you could give your table an id:
var table = document.getElementById("my-table");
to get the html just call
var foo = table.innerHtml;
Upvotes: 0