Hello to everyone, I Have a table inside 2 div's and I need to get the tables id!
How can I do this by javascript?

Since you've provided no code, its difficult to provide specific guidance to solve your issue.

However, take a look at this example, you should be able to adapt to your needs...

<!DOCTYPE html>

<table id="table1"><tr><td>Test</td></tr></table>
<button onclick="myFunction()">Find ID</button>

function myFunction(){
  var x=document.getElementsByTagName("table")[0];


You can copy/paste the above code in this Online HTML Editor to see the results...

Hello JorgeM, thank you for replying to this post of mine! Your example did what I needed for my project, thank you for helping me with this issue.