JSFiddle - React, Tailwind, and code Playground

by Neal

HTML

<p>
    <br/>
    <br>
    <br/>
</p>

<p>
    <br/>
    <br>
    <br/>
</p>

<p>
    <br/>
    <br>
    <br/>
</p>

CSS

p {
  background: blue;  
    margin: 5px;
}

.break {
    background: green;
    height: 20px;
    width: 100%;
}

JavaScript

$('p').each(function(){
    var brs = $('br', this); //all <br>s withing this <p>
    //do something with brs
    brs.each(function(){
        $(this).replaceWith('<div class="break">BREAK</div>');
    })
});