How to insert fieldset inform using jquery now I have this
<form action="" method="post">
all dynamic field generated with db and array
</form>
I want to add fieldset between form tag so code become
<form action="" method="post">
<fieldset>
all dynamic field generated with db and array
</fieldset>
</form>
I'd recommend doing this server-side, but if you really need to use jQuery for this:
$('form').wrapInner('<fieldset />');
Fiddle
.wrapInner
docs
or you can do it like this:
var newForm = "<fieldset>"+$('form').html()+"</fieldset>";
$('form').html(newForm);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With