4 ms·
If you want to get an array of all the table cells in a table, you're probably using the DOM to store data, instead of display data, which is bad IMHO. I prefe
by axod 18y ago
If you want to get an array of all the table cells in a table, you're probably using the DOM to store data, instead of display data, which is bad IMHO.
I prefer having the data in js, pointing to nodes in the DOM, or containing IDs that may need adjustment, updating.
- DanHulton 18y agoOr you're adding rollover events to the table, or styles to the table. Also, the DOM's not a bad place to store data. Why duplicate it elsewhere if it's already in-place in a table? This allows you to say, gracefully upgrade your simple HTML table to a YUI DataTable if your user has javascript enabled.
- axod 18y agoThat's like using a video cards display ram to do inter process communication, or store other program data. Sure though, if you want to add things to a table once loaded to be unobtrusive I can see that use. Although then I'd say just give them sane IDs, and have a js array with the IDs you need to update.