AngularJS Example

HTML

<div ng-app="">
  <div id='dynamicContent'>
      <button ng-click="count = count + 1" ng-init="count=0">
        Increment
      </button>
      <span>count: {{count}} </span>
  </div>
  
    
  <button id='refreshButton'>
    Refresh
  </button>
</div>

CSS

</style> <!-- Ugly Hack due to jsFiddle issue: http://goo.gl/BUfGZ --> 
<script src="http://docs.angularjs.org/angular-1.0.1.min.js"></script>
<style>
.ng-invalid { border: 1px solid red; }

JavaScript

$(document).ready(function(){
    $("#refreshButton").click(function() {
      $("#dynamicContent").html("<button ng-click='count = count + 1' ng-init='count=0'>Increment</button><span>count: {{count}} </span>")
    });
});