Answers for "selector data attribute"

2

jquery select element with data

$('[data-attribute="value"]');
Posted by: Guest on April-01-2020
0

css data attribute selector

[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 October-22-2020
1

select by data attribute

$('*[data-id="your_id"]');
Posted by: Guest on September-10-2020

Code answers related to "selector data attribute"

Code answers related to "Javascript"

Browse Popular Code Answers by Language