I am coding a simple flask project using AJAX.
I am getting a var question
that I want to display in a div #chatbox
.
Whenever I run the code, question
is logged into my console, but on my web-page, the string "question" is displayed in my div #chatbox
.
var question = data['response']
console.log(question)
$( "#chatbox" ).append( "<p>question</p>" );
What is the proper way to append a div
with a var
in it?
" + question + "
" ); ` – palaѕн Mar 18 '20 at 11:27