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
Post a Comment