javascript - Getting raw HTML and re-rendering it as HTML -


i'm creating script rewrite local version of etrack system college uses it's horrific, , have bit of issue formatted text. see, there's div on system class .visitfeedback, , in div has loads of <p> tags. want move these paragraphs scrollable div due paragraphs overflowing normally. issue is, these paragraphs have html styling within them (<strong> etc.). want reserve formatting , add scrollable div. far i've managed move over, methods i've tried far return stuff [object htmlparagraph] instead of text want. far i've tried .get(), .html(), .text(), , few others. can please help? relevant stuff below:

var feedbacktxt;      $('.visitfeedback p').each(function(){         if ($(this).hasclass('info'))         {          }         else         {             feedbacktxt += $(this).text();             $(this).remove();         }     });      $('.visitfeedback').append('<div style="overflow-y: scroll;">' + feedbacktxt + '</div>'); 

why not add overflow-y: scroll elements .visitfeedback class?

$('.visitfeedback').css('overflow-y', 'scroll'); 

Comments

Popular posts from this blog

javascript - Laravel datatable invalid JSON response -

java - Exception in thread "main" org.springframework.context.ApplicationContextException: Unable to start embedded container; -

sql server 2008 - My Sql Code Get An Error Of Msg 245, Level 16, State 1, Line 1 Conversion failed when converting the varchar value '8:45 AM' to data type int -