Kumar Kumar - 1 month ago 5x
CSS Question

How to apply css style to custom attributes

<p target="a"><a>A</a></p>
<p target="b"><a>B</a></p>
<p target="c"><a>C</a></p>
<p target="d" ><a>D</a></p>
<p target="e"><a>E</a></p>

and i can select a custom attribute like this


But how can i add style to this,
I've tried
but its not working.
Thanks in advance


You can use attribute equals selector

$("[target=" + $(this).attr("target") + "]").css(/*propertyName [, propertyValue]*/)