Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

name < td > to later call it and change an attribute

Status
Not open for further replies.

spewn

Programmer
May 7, 2001
1,034
okay, how can i name a <td> to later call it and change an attribute of?

i tried :


<td name='box1'>

and then later used in js:

... document.box1.bgColor = 'red'

this returns that document.box1 is not an object.

so i tried

... document.td.box1.bgColor = 'red'

still no luck.

????? - crispy
 
in IE5+/mozilla(ns6) you can use:

<td id=&quot;benluc&quot;>

<script>
el = document.getElementById(&quot;benluc&quot;);
el.style.backgroundColor = 'red';
</script> jared@eae.net -
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top