Search code examples
javascriptjquerychatterbot

Link not clickable in dynamically added (JQuery) row of list in HTML


I am building a chatbot that provides a link on occasion (using the Chatterbot package as a base). The link comes from python code to my HTML file from where a row is appended to the existing list using JQuery. My problem is that this link does not show up as clickable. I have tried JavaScript link() and html(). I have also tried Anchorme, Autolinker and Linkify.

This is where I am receiving the output from the chatbot:

$submit.done(function(statement) {
    createRow(statement);

And this is the code for the row creation using JQuery:

function createRow(text) {
var $row = $('<li class="list-group-item"></li>');
$row.text(text);
$chatlog.append($row);
}

This is what the output looks like.

screenshot


Solution

  • $row.html(text) should work if the image is anything to go by.