katie
katie

Reputation:

adding a link to text attribute with jquery

Probably a simple question but I need to add a link to the text as below and I am not sure how to do it

callBack: function(me) {
                $(me).text('All done! This is my link to google!').css('color','#090');
            }

Upvotes: 0

Views: 2589

Answers (2)

karim79
karim79

Reputation: 342625

    $(me).html($('<a></a>').attr('href','www.google.com')
                           .text('All done! This is my link to google!')
                           .css('color','#090')
               );

Upvotes: 2

kkyy
kkyy

Reputation: 12450

callBack: function(me) {
  $(me).html('All done! <a href="http://www.google.com">This is my link to google!</a>').css('color','#090');
}

Upvotes: 0

Related Questions