Quick References
ADO
ASP
CSS2
HTML
JavaScript
Jet SQL
VBScript
WML
WMLScript
WSH
XHTML
XML DOM
XSLT
Features
Knowledge Base
Tutorials
Partners
ZVON.ORG
XML
Planet Source Code
VisualBuilder
Web Design
Your HTML Source
XML/XSLT Forums
ASPAlliance
Scripts
Programmers Heaven
Tek-Tips Forums
Developer Fusion
Code Project
class attribute
style attribute
title attribute
ATTRIBUTE: id
id="name"
The
id
attribute is used to assign a identifier value to a tag. Each
id
must be unique within the document and each element can only have one id.
In XHTML, the
id
attribute has essentially replaced the use of the
name
attribute. The value of the
id
must start with an alphabetic letter or an underscore. The rest of the value can contain any alpha/numeric chacracter.
Because it is unique, the value of the
id
can be the target of a URL or used to define a style rule.
There are four attributes common to most tags:
class, id, style,
and
title
.
Code:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>DevGuru XHTML id attribute Example</title>
</head>
<body>
<a href="#ckbx2">Go to Check Box Two</a>
<br />
<input type="checkbox"
id="ckbx1"
/> Check Box One
<br />
<input type="checkbox"
id="ckbx2"
/> Check Box Two
<p
id="_mytext"
>
How now purple cow?
</p>
</body>
</html>
Output:
The use of
id
does not effect the output in any manner.
Copyright 1999-2005 by Infinite Software Solutions, Inc. All rights reserved.
Trademark Information