Is it possible to style an html element (div) by its data member f.e. data-name?
my div:
<div data-name="random_name">...</div>
And is it possible to grab the element by data member that contains certain phrase?
f.e. i want to grab and style every element that its data member contains:
random*
Use below
div[data-name="random_name"] {border:1px solid red;padding:10px;}
<div data-name="random_name">Random name</div>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With