Volodymyr Osypov blog

May 21, 2008

Print HTML DOM Tree

Filed under: JavaScript — Tags: , , — admin @ 11:14 am

In previous article we programmed two functions: to add and remove a table row. But we had one issue in Safari and Firefox by removing a row. We had to click Delete button twice. To understand why this happens we need to see the DOM tree of our table, which each browser builds. You can use browser plugins, but now we will just develop our own simple JavaScript function to print DOM tree.
(more…)

May 20, 2008

HTML DOM, JavaScript to add/remove table rows (part 1)

Filed under: JavaScript — Tags: , , , — admin @ 8:33 pm

I hope you know what DOM is. If no, then I would advise you to read first this tutorial.

We will try to write JavaScirpt code to add/remove rows to table but without using DHTML functions (addRow, addCell etc.), we will use functions to manipulate with DOM tree like appendChild, createElement, createTextNode.
(more…)

Powered by WordPress