How do I rewrite this insert html Jquery:
var element = findLastInput(this).clone();
element.insertAfter(findLastInput(this));
This is the HTML
To insert it after inside the closest div with the class button-row
.
My 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>
The real solution however is jQuery's nextAll method, I assume that you are trying to find the closest '.button-row' after 'this' and are then trying to append 'someHtml':
jQuery(this).nextAll('.button-row:first').append(someHtml);
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.