How can I capture the parent of containers for example I have this structure
<fieldset><!--padre de todos-->
<div class="on">
<!--some conten-->
</div>
<div class="footer">
<!--con este boton necesito capturar el fieldset-->
<button>Capturar padre superior</button>
</div>
</fieldset>
I need to make click
on the button that is inside the footer
capture the father of all, that is the fieldset
example
$("button").click(function(){
//en esta variable capturaria el padre del botón que es el div con la clase footer
var padreSuperior=$(this).parent()
})
How can I access the parent of all by clicking on the button?