Spaces.
The source code uses the following code:
<input ...> <input ...>
Your added HTML uses this code:
<input ...><input ...>
The space between the tags in the first leads to a little extra space (space size) between the tags that are not in the added lines.
A couple of strategies:
In general, you can avoid annoying clutter like this:
<input type=text class=input-mini ><input type=text ...
A sliding angle bracket wraps the next line to eliminate all spaces.
But what you really have to do is reuse the same DOM elements in the added lines as in the originals, so there is no difference line for the line.
The approach that I often use is:
http://jsfiddle.net/b9chris/3Mzs2/17/
Create a single line pattern - I like to use the identifier "T":
<div id=T class="control-group custom"> <input type=text class=input-mini> <input type=text class=input-mini> <input type=text class=input-mini> </div>
Get the template string and delete its identifier, and then just clone it when you need to add one - this way, any HTML that you used in the original is reused in your uploads:
var plus = $('#plus_time_button').closest('div'); var T = $('#T'); T[0].id = ''; for(var i = 0; i < 3; i++) plus.before(T.clone()); $('#plus_time_button').click(function () { plus.before(T.clone()); });
My original answer used your existing event syntax with .live (). Converting to jQuery 1.9 syntax is not required, since you are apparently still at 1.7 or 1.8, but if you want, the code above removes the living (it actually discards it completely since it is no longer needed) the tag about speech is never deleted from the DOM). Examples of conversion of .live () calls for 1.9 are given in the jQuery documentation:
http://api.jquery.com/live/#entry-longdesc