Darshan Kshirasagar

Darshan Kshirasagar

  • NA
  • 317
  • 69.2k

JavaScript String Data Format loosing when load to Div Tag

Jan 24 2019 4:37 AM
Hi All,
 
      I have textbox as formatted as given in PrintTest.txt file in RAR file.
But when i try to load TextBox Data same to Div tag then it not proper as in textbox not with alignment its not .
 
 
 Code is Below:
 
@Html.TextAreaFor(m => m.ReportText, htmlAttributes: new { @class = "ReportText", @id = "txtReport", @wrap = "off", @readonly = "readonly" })
<div id='DivIdToPrint'>
</div>
 
 
Javascript :
 
var mydiv = $("#txtReport").val();
document.getElementById("DivIdToPrint").innerText = mydiv;
 
 
Please help me 

Attachment: PrintTest.rar

Answers (2)