I'm trying to add a href link to jquery append. The link opens an ajax modal when clicked.
here's what I have
$('<div/>').text(message.text).prepend($('<em/>')
.text('Opponent: '+ opponentName + ',' + ' ' + 'Game amount: ' + message.amount + ' ' + 'tokens,' + ' ' + 'Game: ' + message.game + ' ' + '<a href="#" data-toggle="ajaxModal">accept</a>')).appendTo($('#pendingChallenges'));
$('#pendingChallenges')[0].scrollTop = $(' #pendingChallenges')[0].scrollHeight;
<div><em>message.text</em>Opponent: opponentName, Game amount: amount tokens, Game: game<a>accept</a>?</div>. :)#pendingChallengesis an id for.