Reputation: 253
I want to remove the div that has class "form-group" but I don't want to remove the code inside of it. jQuery unwrap should do this but I'm not sure how to write the code.
<form class="navbar-form">
<div class="form-group">
<input type="text" id="search" class="form-control" placeholder="Search">
<button class="btn btn-primary modal-search" type="submit">
<span class="icon icon-search"></span>
</button>
</div>
</form>
Upvotes: 1
Views: 378
Reputation: 15860
You can also save the data of the div and then append it to the form once you're done. Here is a fiddle example for that:
http://jsfiddle.net/afzaal_ahmad_zeeshan/pPGj2/
The code was:
var dataContent = $('.form-data').html();
$('.form-data').remove();
$('form').append(dataContent);
Upvotes: 0