JSFiddle - React, Tailwind, and code Playground
by Thabelo Mmbengeni
January 17, 2014
HTML
<div contentEditable="true" id="clean-text-div"> </div>
<div id="clean-btn"> Clean Me</div>
<div id="message"> paste html content and clean background HTML for pure text</div>
CSS
#clean-text-div{ width: 300px; height: 25px; border: 1px solid gray; margin: 5px; }
#clean-btn{ background: orange; padding: 5px; border: 1px solid red; height: 25px; line-height: 25px; width: 100px; margin: 5px; text-align: center; border-radius: 3px; }
#clean-btn:hover{ cursor: pointer; border: 1px solid #000; margin-top: 5px; }
#message{ width: 100%; margin-left: 5px; }
JavaScript
$("#clean-btn").click(function(){
$("#clean-text-div").text($("#clean-text-div").text());
$("#message").text("Your text is now clean");
});