I have the following snippet of code: This is where I'll place the 'li' elements. <ul id="file-list"></ul>
After processing the file upload I add the elements like this: $("#file-list").append('<li>' + fileName + ' <a href="' + filePath + '" class="file"><img src="attributes.gif" alt="" /></a></li>'); The thing is, I can't get the onclick event on those links, it just do nothing when I click on it. If I already have a <ul id="file-list"><li>MyFile <a href="something.zip" class="file"><img src="attributes.gif" alt="" /></a></li></ul> <-- Works fine.