I am trying to pass HTML text to my div , I need this line, presented as HTML elements, My code:
<div id="divchat" style="width: 500px; height: 300px; border: 2px solid brown;"/></div> @Html.TextBoxFor(model => model.msj) <button type="submit" id="btnSend">Send</button> <script> $(function(){ var chatNS = '@HttpContext.Current.Application["Chateo"].ToString()'; $("#divchat").append(chatNS); }); </script>
div shows the content just like a string, how can I get HTML elements to display correctly in divchat ?
source share