This clears the values ββof all text areas that are in the parent with id parent .
$('#parent').children('textarea').val('');
Here is an example http://jsfiddle.net/Y2t7x/1/
The important thing is that the script clears only text areas that are direct siblings from #parent and not nested.
If you want to reset the values ββof the text areas that belong to the siblings of the parent, you must replace children with find .
If you want the script to work with text inputs, use:
$('#parent').children('input[type=text]').val('');
or
$('#parent').find('input[type=text]').val('');
Again depending on your needs.
source share