Revert to original html after pressing Esc button
<p>I modified an html thru javascript and I want that when I click esc, it will go back to the html's original form:</p>

<pre><code>if ($("#div").show()) {
    $("#div1").empty();
    $("#div1").html("&lt;input class='tabledit-input form-control' type='text' value='" + file[0].name + "'&gt;");

    $("#div2").empty();
    $("#div2").html("&lt;input type='text' class='form-control' placeholder='div2'&gt;");

    $("#div3").empty();
    $("#div3").html("&lt;input type='text' class='form-control' placeholder='div3'&gt;");
} else if (e.keyCode == 27) {
    //what to do here?
}
</code></pre>