Answers for "access data attribute in css"

1

data attribute css

a[href="https://css-tricks.com"] {
  color: #E18728;
}

[data-value] {
  /* Attribute exists */
}

[data-value="foo"] {
  /* Attribute has this exact value */
}

[data-value*="foo"] {
  /* Attribute value contains this value somewhere in it */
}

[data-value~="foo"] {
  /* Attribute has this value in a space-separated list somewhere */
}

[data-value^="foo"] {
  /* Attribute value starts with this */
}

[data-value|="foo"] {
  /* Attribute value starts with this in a dash-separated list */
}

[data-value$="foo"] {
  /* Attribute value ends with this */
}
Posted by: Guest on June-06-2021
0

js select by data attribute

$("[attribute=value]")
Posted by: Guest on December-17-2020

Code answers related to "access data attribute in css"

Code answers related to "Javascript"

Browse Popular Code Answers by Language