Reputation: 11
There is such a HTML code:
<div class="addMore"></div>
<div class="adProfInner">
<div class="formAdd"><form></form></div>
</div>
By clicking on the addMore need to reset the form to the container formAdd
Here is that code did not work:
$(this).next('.adProfInner').find('form').trigger('reset');
Upvotes: 0
Views: 60
Reputation: 314
You can also use this method.
$('.addMore').click(function(){
$(this).next('.adProfInner').find('form').reset();
});
or
<div class="addMore"></div>
<div class="adProfInner">
<div class="formAdd"><form id='my_form'></form></div>
</div>
script here
$('.addMore').click(function(){
$('#my_form').reset();
});
Upvotes: 0
Reputation: 12039
Can try using reset()
. Example:
$('.addMore').click(function(){
$(this).next('.adProfInner').find('form')[0].reset();
});
Upvotes: 2