Problem with jquery.click() after writing tags with $('ul li').html(Item);
Hello,
i have a Problem with the following code after writing it with $('ul li').html(Item);
- $("#sideBar li").click(function() {
- alert($(this).html());
- }
When i write the li-tags in the ul#sideBar manual, it works fine.
The following jQuery writes the li-Tags in the ul with the id "#sideBar":
- $.ajax({
- type: 'post',
- url: "ajax/getSideBar.xml",
- dataType: 'xml',
- global: false,
- success: function(xml) {
-
- var Item = '';
- $(xml).find('Marker').each(function() {
- var title = $(this).find("title").text();
- Item += '<li>'+title+'</li>';
- });
- $('#sideBar').html(Item);
- },
- });
That works fine too,but now the $("#sideBar li").click(function() { do nothing!?
Do you have any idears?
Greetz
Helmutha