Find text of a <li> in a dynamic <ul> on button click Jquery
<p>I am populating a list of friends using an ajax call to a php script that returns a json array . I am populating each list item with the friends name and putting a button next to it. The name and the button are both in the list item. I want to find the friends name when i click on the button so I can then post it to another script that will remove them from the friends list. As well, I need to select the entire list item when the user clicks on the side button so I can immediately remove it from the unorganized list. The issue that I am having is that I am trying to call something like $(this).find('font').text(); but this is only referring to the button that was clicked and not the entire list item. I'm sure it's something simple that I'm overlooking but it has been giving me grief for too long now. </p>

<p>The HTML</p>

<pre><code>&lt;ul data-role="listview" data-inset="true" id="friends" data-theme="a" 
data-divider- theme="a"&gt;
    &lt;li data-role="list-divider"&gt;&lt;h3&gt;Friends&lt;/h3&gt;&lt;/li&gt;
&lt;/ul&gt;
</code></pre>

<p>The Javascript</p>

<pre><code>    function getFriendsList(){
    var searchType = "friend";
    var friendList = "";
        var friendName = "";
        var friendPoints = "";
    var name = "";
    $.post('friendScript.php', {
        searchType : searchType,
    }, function(data){
        $.each(data, function(index, value){
            $.each(value, function(index, item){
            if(index == 0){
                friendName = item;
            }
            if(index == 1){
                friendGratii = item;
            }   
        });
        friendList += '&lt;li class="friend"&gt;&lt;a href=""&gt;&lt;h3&gt;' + 
                                  '&lt;font id="friendsName"&gt;' + 
                                  friendName + 
                                  '&lt;/font&gt;' + " - " + 
                                  friendPoints + 
                                  '&lt;/h3&gt;&lt;/a&gt;' + 
                                  '&lt;a href="" id="defriend" data-icon="delete"&gt;' +
                                  "Remove Friend " + '&lt;/a&gt;' + '&lt;/li&gt;';
    });
    $('#friends').append(friendList).listview('refresh');
            $('#friends').find('li:has(font)').find('#defriend')
            .unbind("click").bind("click",  
                function(){
        var clickedFriend = $(this);
            name = $(this).find('.friend').text(); //HERE IS THE PROBLEM IT 
                                                        //ALWAYS RETURNS AN EMPTY STRING
                        $.post('defriendScript.php', {
                friendName : name,
            }, function(data){
                if(data != "success"){
                alert(data);
                }
                if(data == "success"){
                    $(clickedFriend).remove();
                }
            });
        });
    }, "json"); 
    };
</code></pre>
