JSFiddle - React, Tailwind, and code Playground
HTML
<div title="foo">This div has a title.</div>
<div>This div does not have a title.</div>
CSS
div:after {
content: "NO";
}
div[title]:after {
content: "YES";
}
<div title="foo">This div has a title.</div>
<div>This div does not have a title.</div>
div:after {
content: "NO";
}
div[title]:after {
content: "YES";
}