Connecting Tech Pros Worldwide Forums | Help | Site Map

xhtml--id OR name--

Familiar Sight
 
Join Date: Nov 2006
Location: PJ,Malaysia
Posts: 255
#1: Feb 1 '07
The id attribute and name attribute in xhtml.

I read from w3schools.com that ALL name attribute is replaced by id attribute.

so this code
Expand|Select|Wrap|Line Numbers
  1. ...
  2. <input type="checkbox" name="checkbox1" value="value" checked="checked" />CheckBox 1
  3. <br />
  4. ...
  5.  
should changed to
Expand|Select|Wrap|Line Numbers
  1. ...
  2. <input type="checkbox" id="checkbox1" value="value" checked="checked" />CheckBox 1
  3. <br />
  4. ...
  5.  
I mean in XHTML.
Also there is another question, checked="checked" is correct right?

from
nick

drhowarddrfine's Avatar
Expert
 
Join Date: Sep 2006
Posts: 5,574
#2: Feb 1 '07

re: xhtml--id OR name--


On your first question, yes, XHTML is XML and the name attribute is not allowed. Here's the official word on that from the W3C.

And your second question is correct, too.
Familiar Sight
 
Join Date: Nov 2006
Location: PJ,Malaysia
Posts: 255
#3: Feb 2 '07

re: xhtml--id OR name--


thanks mod.

:)
Reply