<script type="text/javascript"> $(function() { $('div[id^="menu_"]').each(function() { alert(this.id); }); }); </script>
On Thu, May 28, 2009 at 10:56 AM, Dave Maharaj :: WidePixels.com < d...@widepixels.com> wrote: > There are going to be multiple .test on the page.... how can i alert(myID) > for all the elements on the page.... just testing it so i can see its gtting > them all? > > Thanks > > Dave > > ------------------------------ > *From:* waseem sabjee [mailto:waseemsab...@gmail.com] > *Sent:* May-28-09 2:55 AM > *To:* jquery-en@googlegroups.com > *Subject:* [jQuery] Re: Get ID > > var myID = $(".test").attr("id"); > > alert(myID); > > On Thu, May 28, 2009 at 6:24 AM, Dave Maharaj :: WidePixels.com < > d...@widepixels.com> wrote: > >> How do you find an ID that is generated dynamically? >> >> <div id="menu_<?php echo $variable ;?>" class="test"> >> >> Dave >> > > -- I have failed as much as I have succeeded. But I love my life. I love my wife. And I wish you my kind of success.