Welcome Guest! (App Version 3.1)

websitnero logo name

Attribute Based Selectors

Selectors based on attributes of Elements

Attribute based selectors are those which make selection of elements based on their attribute values. Often, the selection can be those elements who have certain attribute with value starting with a certain alphabet or ending with certain alphabet, etc. Even spaces or hyphens in attribute value can be counted for selection of elements.

Look at the table below to have better understanding of these kinds of selectors:

Attribute Based Selectors
S.No.NameRepresentationDescriptionExamples
1Exactly equals[attr=val]Selects all elements with attribute equals val
2Starts with[attr^=val]Selects all elements with attribute starting with val
3Ends with[attr$=val]Selects all elements with attribut ending with val
4Hyphenated at[attr|=val]Selects all elements with attribute hyphanated with val
5Spaced at[attr~=val]Selects all elements with attribute spaced with val
6Contains string[attr*=val]Selects all elements with attribute containing val
WebsiteNero is highly optimized for learning various website developing technlogies. We try our best to add maximum modules and examples to help learn the concepts clearly and vividly. We try to present all content and examples as simple as we can removing any complexity to hurdle easy understanding. We try best provide you with worthful content, but we cannot guarantee full correctness of all the content on this site. While using this website, you agree to have read and accepted all our terms of use and conditions, cookie, and privacy policy. Copyright, 2013-2018 by websitenero.com. All Rights Reserved.