ExampleSet a background color on all div elements that have a class attribute value that begins with "test":
Try it yourself » |
The [attribute^=value] selector matches every element whose attribute value begins with a specified value.
The [attribute^=value] selector is supported in all major browsers.
Note: For this selector to work in IE, a <!DOCTYPE> must be declared.
![]() |
Try it Yourself - Examples |
ExampleSet a background color on all elements that have a class attribute value that begins with "test":
Try it yourself » |