title: How to add a cancel button for 'contenteditable' editable field?
body: <p>I want to add a cancel button to this editable fields which would make the field non-editable and undo the current changes made. </p>
  
  <pre><code>$('button').on('click', function() {
    if ($(this).hasClass('save')) {
      alert("Saved!!!");
      $(this).text("Edit").removeClass('save');
      $('.company').attr('contenteditable', 'false').css({
        'border': 'none',
        'outline': 'none'
      });
    } else {
      $(this).text("Save").addClass('save');
      $('.company').attr('contenteditable', 'true').css({
        'border': 'black solid 1px',
        'outline': 'none'
      }).focus();
    }
  });
  </code></pre>
  
  <pre><code>&lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"&gt;&lt;/script&gt;
  &lt;div class="row text-center company"&gt;Company Name&lt;/div&gt;
  &lt;button class="btn btn-default edit"&gt;Edit&lt;/button&gt; &lt;button class="btn btn-default cancel"&gt;Cancel&lt;/button&gt;
  </code></pre>