After ul tag i want to call function in javascript to add list item dynamically
and inside i want to place image tag as shown below.
<li> <img src="images/testpic" height="200px" width="200px" /> </li>
i have used .append() method in jquery but doesn’t work
<script type="text/javascript">
'$('ul').append("<li><img src='thumbs/image"+i+".jpg' width='175' height='175' /></li>");
'$('ul').append("<li><img src='thumbs/image"+i+".jpg' width='175' height='175' /></li>");
'$('ul').append("<li><img src='thumbs/image"+i+".jpg' width='175' height='175' /></li>");
From a for loop
From an Array of Images
If all you’re wanting to do is add list items with images inside:
Fiddle: http://jsfiddle.net/YwH7Z/