Here is my piece of HTML for your reference written in an aspx page which works as expected by you:-
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
<style type="text/css">
.form-control{
border-color:red;
border-width:2px;
height:50px;
width:200px;
}
.has-ns{
background-color:green;
}
</style>
<script src="Scripts/jquery-1.10.2.js"></script>
<script type="text/javascript">
$(function () {
$("#btnAdd").bind("click", function () {
var div = "<div>" + GetDynamicTextBox("SmrutiRanjan", "smruti.sahoo@gmail.com") + "</div>";
$("#TextBoxContainer").append(div);
$('input[name=ContactName]').addClass('form-control has-ns');
return false;
});
$("body").on("click", ".remove", function () {
$(this).closest("div").remove();
});
});
function GetDynamicTextBox(valuename, valueemail) {
return '<input name="ContactName" type="text" value="' + valuename + '" /> ' + '<input name="ContactEmail" type="text" value="' + valueemail + '" /> ' +
'<input type="button" value="Remove" class="remove" />';
}
</script>
</head>
<body>
<form id="form1" runat="server">
<div id="TextBoxContainer"></div>
<input type="button" id="btnAdd" value="Add" />
</form>
</body>
</html>
Hope this will definitely of help to you.