Kumar Kumar - 1 year ago 88
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

Answer Source

You can use attribute equals selector

$("[target=" + $(this).attr("target") + "]").css(/*propertyName [, propertyValue]*/)
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download