Click to See Complete Forum and Search --> : dynamic A tag


z_mirza
04-05-2003, 03:49 PM
hey all, i just created my first dynamic talbe and there are links in the table and i was wondering how do you create a dynamic anchor tag. in its smiliest form because i am a nebiew at javascript. heres my code for the table
function makeTable()
{
var links = new Array;

links[0] = "<a href='CenterTag.htm' id='Element'>Center</a>";
links[1] = "<a href='UnorderListTag.htm' id='Element'>Ul</a>";
links[2] = "<a href='OrderedListTag.htm' id='Element'>Ol</a>";
links[3] = "<a href='TableTag.htm' id='Element'>Table</a>";
links[4] = "<a href='FramesetTag.htm' id='Element'>Frameset</a>";
links[5] = "<a href='ImageTag.htm' id='Element'>Img</a>";

var content = new Array;

content[0] = "Deprecated. Centers Content.";
content[1] = "Creats an unorded list. The list items appear as bullets.";
content[2] = "Creates an ordeld list. The list items appear a numbers.";
content[3] = "Defines a table.";
content[4] = "Creates frames.";
content[5] = "Displays an image.";

var oRow, oCell, i;
for (i = 0; i < links.length; i++)
{
oRow = ElementTable.insertRow();
oCell = oRow.insertCell();
oCell.colSpan = "2";
oCell.innerHTML = links[i];
oRow = ElementTable.insertRow();
oCell = oRow.insertCell();
oCell.width = "20";
oCell = oRow.insertCell();
oCell.innerText = content[i];
}
}