> Can you give some exemple ? $("#IdButton").click( function() { var pic="<p><img id=\"IdPicture\" name=\"IdPicture[]\" class="whatever" src=\"../ images/icone_ko_small.png\"/></p>" $(this).before(pic); });
$("img.whatever").livequery('click', function(event) { $(this).remove(); }); regards, f. > > The probleme is: i want to remove, let's say, the 4th image, by > clicking on it. I don't see where class can help me. I surely must use > some kind of array but in which way ? > > regards, > > f. > > > You can use the live event gestion if you use jquery > 1.3 > > (http://docs.jquery.com/Events/live) > > Pierre > > > 2009/6/12 fabrice.regnier <fabrice.regn...@gmail.com> > > > > Hi all, > > > > When i click once on a button, i create one picture on the fly. And so > > > on. It works ok. > > > > Then, using livequery, when i click on one of the all created > > > pictures, i would like to see it removed. But it appears that only the > > > first pic is removed (since all have the same name). > > > > What is my mistake ? > > > > regards, > > > > f. > > > > <JQUERY> > > > > $("#IdButton").click( function() { > > > var pic="<p><img id=\"IdPicture\" name=\"IdPicture[]\" src=\"../ > > > images/icone_ko_small.png\"/></p>" > > > $(this).before(pic); > > > }); > > > > $("#IdPicture").livequery('click', function(event) { > > > $(this).remove(); > > > }); > > > > <HTML> > > > > <input type="submit" id="IdButton" class="button">