when I want to remove div element, I have the following code:
<div class='text-field'>
<input type='text' />
<input type='button' class='remove-btn' />
</div>
<div class='text-field'>
<input type='text' />
<input type='button' class='remove-btn' />
</div>
<div class='text-field'>
<input type='text' />
<input type='button' class='remove-btn' />
</div>
<div class='text-field'>
<input type='text' />
<input type='button' class='remove-btn' />
</div>
when i click remove-btn, its parent div text-field should be removed. i have this code but it doesnt work.
$(".remove-btn").click(function(){
$(this).parent().remove();
});
thanks for any help. :)