What if you want to change the attributes of some related items?
Say you have table cells:
<tr>
<td id="col1">row 1 column 1</td>
<td id="col2">row 1 column 2</td>
</tr>
<tr>
<td id="col1">row 2 column 1</td>
<td id="col2">row 2 column 2</td>
</tr>
*
*
*
You can change the column width for all cells in the column with:
document.getElementById("col1").style.width = 100;
This works with Safari, Mozilla, Firefox -- Haven't tested in IE yet.
You can't accomplish this with class because there is no
getElementByClass method
Dick
On Oct 20, 2004, at 9:30 AM, Andy Allan wrote:
> The ID attribute is unique. It should apply to one and only one <div>.
>
> Use the class attribute for general styles.
>
> Andy
>
>
> On Wed, 20 Oct 2004 12:06:20 -0400, Damien McKenna
> <[EMAIL PROTECTED]> wrote:
>> Which is the more correct method for calling CSS styles, to use the id
>> attribute or the class attribute? Can IDs be nested, e.g. #box
>> #inside
>> #field {...}, like classes can be, e.g. table.box th.inside td.field
>> {...}.
>> --
>> *Damien McKenna* - Web Developer - [EMAIL PROTECTED]
>> <mailto:[EMAIL PROTECTED]>
>> The Limu Company - http://www.thelimucompany.com/ - 407-804-1014
>> "Nothing endures but change." - Heraclitus
>>
>>
>
>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Purchase from House of Fusion, a Macromedia Authorized Affiliate and support the CF
community.
http://www.houseoffusion.com/banners/view.cfm?bannerid=35
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:182039
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54