var element = findLastInput(this).clone();
element.insertAfter(findLastInput(this));
これは、クラスbutton-row
に最も近いdivの内側の後にそれを挿入するにはHTML
です。
マイHTML:
<div class="input numeric integer optional">
<label for="company_webserver" class="integer optional"> Webserver</label>
<input type="number" step="1" size="50" name="company[webserver]" id="company_webserver" class="numeric integer optional">
</div>
<div class="button-row" style="font-size: 11px; width: 110px; float: right; margin-top: -10px; margin-right: 16px;">
<button style="font-size: 11px;" type="button" class="add">Add info</button>
<button style="font-size: 11px;" type="button" class="remove">Remove</button>
</div>
「this」は何を参照していますか? 「要素」とは何ですか? –
「近い」とはどういう意味ですか? – sdleihssirhc
@Felix - さらに必要な情報を追加して質問を更新しました –