Equality [=] Attribute Selector
Exactly matches the specified attribute value.
Syntax
HTML [att=val] { sRules } Scripting N/A
Possible Values
att Must be either an Identifier or a String. val Must be either an Identifier or a String. sRules String that specifies one or more Cascading Style Sheets (CSS) attribute/value pairs.
Remarks
This selector is available as of Internet Explorer 7.
Attribute selectors are enabled only in standards-compliant mode (strict !DOCTYPE).
Attributes are case-sensitive.
Example
The following style rule selects any attribute whose value is exactly "Value."
<style> .test { display:none; } [attr="Value"] { display:block; } </style> <div class="test" attr="Value">Test for [=] (Value) succeeded.</div>
Standards Information
This selector is defined in CSS, Level 2 Revision 1 (CSS2.1).
See Also
Class Selector, Existence [] Attribute Selector, Hyphen [|=] Attribute Selector, ID Selector, Prefix [^=] Attribute Selector, Substring [*=] Attribute Selector, Suffix [$=] Attribute Selector, Type Selector, Universal (*) Selector, Whitespace [~=] Attribute Selector