[Javascript] how to refer to (x)html elements

Chris Tifer christ at saeweb.com
Thu Nov 13 08:06:35 CST 2003


> The real problem with "id" in HTML (and correspondingly in JavaScript) is
> that it tries to do too many things.  For example, one can define a CSS
> style block thusly:
>
> <style TYPE='text/css'>
> <!--
>     #normaltext { font-family: arial,helvetica,sans-serif; font-size: 8pt;
> vertical-align: middle; text-indent: 0.4em; border-style: solid;
> border-width: 1pt }
> // -->
> </style>


You CAN do it that way, but Classes are the preferred method if you're going
to have multiple instances that should look the same - at least I've always
been told.




More information about the Javascript mailing list