AngularJS Example:

HTML

<link rel="stylesheet" href="http://twitter.github.com/bootstrap/assets/css/bootstrap.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>
<div ng-app>
  <h2>Todo</h2>
  <div ng-controller="TodoCtrl">
      <div id="abc"></div>
      <input type="text" ng-model="txt"></input>
      <button ng-click="addBefore()">Add Before</button>
</div>
</div>

CSS

#abc {
    height: 50px;
    width: 400px;
    border: 1px solid;
}

JavaScript

function TodoCtrl($scope) {
  $scope.txt = "";
    $scope.addBefore = function() {
        $("#abc").before('<div><input type="text" value="' + $scope.txt + '"/></div>');
    };
}