I am trying to alter the ins tag style attribute on html which looks like this
<ul>
<li class="pad">
<a>
<ins style="margin-left: 5px"></ins>
</a>
</li>
<li class="no_pad">
<a>
<ins style="margin-left: 0px"></ins>
</a>
</li>
<li class="pad">
<a>
<ins style="margin-left: 5px"></ins>
</a>
</li>
<ul>
I only want to grab the list elements with the “pad” class tag. How can I grab all the list elements and then get down to the ins tag to edit the style attribute on it?
Use a simple CSS selector:
This will add the
cssPropertyNameproperty, and set its value to the suppliedcssPropertyValue.If you’d rather, albeit unnecessarily, use the
attr()method:References:
attr().css().