I have
<div id="aa">
<img src="." height="17" alt="example1" title="">
<table>
<tbody><tr>
<th></th>
<td></td>
</tbody>
</table>
<img src="." height="17" alt="example2" title="">
<table>
<tbody><tr>
<th></th>
<td></td>
</tbody>
</table>
<img src="." height="17" alt="example3" title="">
<table>
<tbody><tr>
<th></th>
<td></td>
</tbody>
</table>
</div>
I only want to select the attributes "alt" values "example1, example2, example3" of images. How can I get them.
I presume you mean that you want to select all the images (in CSS) that contain example*
in the alt attribute, so you can style them. (and that you don't mean that you actually want tot select the text set in the alt attribute)
You can use the attribute selector:
img[alt~="example"] {
border: 1px solid red;
}
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