I need to select a HTML element based on data in an attribute called "data-attributes". In Firefox's DOM Inspector, the attribute value appears like this:
<div data-attributes="[{"Id":50,"Code":"LIC","ShowInSessionFilter":false}]"> I have tried using a CSS selector like below, to no avail:
div[data-attributes~="LIC"] So I assume the attribute value is not a string as such, but a javascript object being shown by the Inspector as a Json string. The question is, how do I select the node based on one of the key/value pairs in the object it contains? Is this possible in CSS?
~=would not be the proper check, as that looks for "a space separated list of words."