Forum Moderators: open
someTable = document.getElementById("exampleTable");
rows = someTable.tBodies[0].rows
vs.
someTable = document.getElementById("exampleTable");
tBodies = someTable.getElementsByTagName("tbody");
rows = tBodies[0].getElementsByTagName("tr");
Given that the HTML DOM is not a feature of the level 2 and 3 recommendations I would guess that using the core methods, although longer, is the preferred (futureproof) route.
I am interested to see to what degree (if at all) other people agree, especially so given that there are some facilities in the HTML DOM (getting the indices of selected options in a select-list, for example) that are really quite difficult to replicate using the core methods only. So, which approach do you use, and why?
What I'm looking for is more what peoples' opinions are regarding the use of HTML DOM vs. core DOM - is it good programming practice? Or something you should only use for quick-and-dirty mockups? And why?