JSFiddle - React, Tailwind, and code Playground by maros_urbanec January 11, 2013 HTML <div class="container"> <div class="floatedText">This is floated left</div> </div> <div> This text should be under the container and container should be red. Fix me by pressing <input type="button" id="example" value="here" />. </div> CSS .container { background-color: red; } .floatedText { float: left; } .clearer { clear: both; } JavaScript $(window).ready(function(){ $("#example").click(function(){ $(".container").append("<div class='clearer' />"); }); })