jQuery attributeContainsPrefix [name^="value"]
vs
attributeStartsWith [name|="value"]
What the practical difference?
Attribute Contains Prefix Selector in the Manual:
Selects elements that have the specified attribute with a value either equal to a given string or starting with that string followed by a hyphen (-).
This selector was introduced into the CSS specification to handle language attributes.
That means it will match en
and en-US
but will not match entanglement
like the other would. And this is not only good for languages, but anything that can be prefixed.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With