Loading page content and then using jquery on this content

Loading page content and then using jquery on this content

Using jQuery I'm getting a JSON object and are looping through it creating list items (LI). Each item has a class for style and a unique ID from the JSON object. I now want to create a function that for now creates and alert alerting the ID. How can I do this?? At the time of he page load I don't know the ID and amount of list items that will be on my page.