jquery - Add Element/Paragraph after html BR? -


evening all!

i'm having issues styling out few pages on site. problem i'm having information that's being pulled , displayed on page has no real styling included, contain <brs>which end rendering content quite ugly!

i'm looking see if there's way can insert paragraph tag, after br element, before text. , add closing paragraph tag after text, before br tag underneath. - putting text that's between breaks paragraphs allow further styling.

i've dropped example on on: http://jsfiddle.net/fish_r/9efc8/ - here, i've started experimenting

    $( "#property-info p br" ).before( "<p>" ); 

but adds punch of paragraph tags around br's rather around text.

i don't have control of way information output onto page manually.

please try below code part. can set p tag.

$( "#property-info p br" ).each(function( index ) {   //console.log( index + ": " + $( ).text() );     $(this).before('<p>'); }); 

http://jsfiddle.net/9efc8/2/


Comments

Popular posts from this blog

java - Intellij Synchronizing output directories .. -

git - Initial Commit: "fatal: could not create leading directories of ..." -