How to set a value for a <span> tag using jQuery…

For example…

Below is my <span> tag:

<span id="submittername"></span>

In my jQuery code:

jQuery.noConflict();
    
jQuery(document).ready(function($){

    var invitee = $.ajax({
        type: "GET",
        url: "http://localhost/FormBuilder/index.php/reports/getInvitee/<?=$submitterid;?>",
        async: false
    }).responseText;

    var invitee_email=eval('(' + invitee + ')');
    var submitter_name=$.map(invitee_email.invites, function(j){ 
        return j.submitter;
    });         
    alert(submitter_name); // alerts correctly 
    $("#submittername").text(submitter_name); //but here it is not working  WHy so??????
});

6 Answers
6

Tags:

Leave a Reply

Your email address will not be published. Required fields are marked *