JQuery Get all <alt> tags with <img> and show them in <ul> <li>
This is my html (im using the Galleria image gallery - based on jQuery)
<div id="galleria">
<img alt="Productname 1" src="bens_img/1.jpg">
<img alt="Productname 2" src="bens_img/2.jpg">
<img alt="Productname 3" src="bens_img/3.jpg">
<img alt="Guess what?" src="bens_img/4.jpg">
</div>
Pseudo code
Get string from <alt> from <img>
Create a new <li> and paste the <alt> string from <img> in it
This needs to be done with all (i.e. four) img alt lines. It should look like this:
<ul class="textformat">
<li>Productname 1</li>
<li>Productname 2</li>
<li>Productname 3</li>
<li>Guess what?</li>
</ul> <!-- yeah this was all done by java-script -->
+3
5 answers