HTML[att$=val] { sRules } ScriptingN/A
attMust be either an Identifier or a String. valMust be either an Identifier or a String. sRulesString that specifies one or more Cascading Style Sheets (CSS) attribute/value pairs.
Note Requires Windows Internet Explorer 7 or later. Note Attribute selectors are enabled only in standards-compliant mode (strict !DOCTYPE).Attributes are case-sensitive.
Attributes are case-sensitive.
The following style rule selects any attribute whose value ends with "n." <style> .test { display:none; } [attr$="n"] { display:block; } </style> <div class="test" attr="Green">Test for [$=] (Suffix) succeeded.</div> This feature requires Windows Internet Explorer 7 or later. Click the following icon to install the latest version. Then reload this page to view the sample.
The following style rule selects any attribute whose value ends with "n."
<style> .test { display:none; } [attr$="n"] { display:block; } </style> <div class="test" attr="Green">Test for [$=] (Suffix) succeeded.</div>
This selector is defined in Cascading Style Sheets (CSS), Level 3 (CSS3).
Class Selector, Equality [=] Attribute Selector, Existence [] Attribute Selector, Hyphen [|=] Attribute Selector, ID Selector, Prefix [^=] Attribute Selector, Substring [*=] Attribute Selector, Type Selector, Universal (*) Selector, Whitespace [~=] Attribute Selector