View Single Post
Old 10-10-2007, 10:30 AM   #1 (permalink)
meshi
The Contributor
Upcoming Programmer 
 
meshi's Avatar
 
Join Date: Oct 2007
Posts: 44
Thanks: 0
meshi is on a distinguished road
Default how to put span in Js

Code:
function addRow(con,pos,tel,email)
{
	var tbody=document.getElementById('contact').getElementsByTagName("TBODY")[0];
	var row = document.createElement("TR");
	var td1 = document.createElement("TD");td1.appendChild(document.createTextNode(con));
	var td2 = document.createElement("TD");td2.appendChild(document.createTextNode(pos));
	var td3 = document.createElement("TD");td3.appendChild (document.createTextNode(tel));
	var td4 = document.createElement("TD");td4.appendChild(document.createTextNode(email));
	row.appendChild(td1);row.appendChild(td2);row.appendChild(td3);row.appendChild(td4);tbody.appendChild(row);
}
function applystyle(id)
{
	if(document.getElementsByTagName)
{
	var table = document.getElementById(id);
	var col = table.getElementsByTagName("td");
	for(i = 4; i < col.length; i++)
	{
		col[i].className = "table-list-entry1";
	}
}
}
the output of this is
con pos tel email
meshi janitor 0555 dfdsf@y.com

if i put a span tags in the email side how would i do that in scripts
hope u could help me
PS
my span has also a class="notaction"
how would i add it to my code
meshi is offline  
Reply With Quote