Is this jquery/javascript statement correct and valid.
$('.icon_edit').click(function(){
$(this).parent().hide().siblings('span').hide();
});
<div class="dataBox">
<span>
<input class="chkbox" type="checkbox"/>
</span>
<span class="memName">test1</span>
<span class="memNum">9791091380</span>
<span class="memDesc">test 1</span>
<span>
<a class="icon-delete" > </a>
<a class="icon-edit" > </a>
</span>
<div>
<input class="editName"/>
<input class="editNum"/>
<input class="editDesc"/>
</div>
</div>
I was actually trying to hide the selected elements parent + all the siblings of the parent which are 'span' element in a single statement. Is there a better way to do this.? NB:Actually this code is working for me. But not sure if its violating any syntax or selection rules of javascript/jquery.This is how I did it in 2 statements
$(this).parent().hide().siblings('span').hide();
$(this).parent().hide();