Consider following code snippet:

<div>
    <p style="visibility:hidden">Something_1</p>
    <p hidden>Something_2</p>
    <footer>
        <p style="display:none">Something_3</p>
    </footer>    
</div>
<script>
    function ReturnValue(){
        var countElem = $('div').find('p').length
        -$('div').children('p').length;
        return countElem;
    };    
</script>
What value will return the ReturnValue function?
Explanation
find() method returns descendant elements of the selected element; childred() method returns all direct children of the selected element; examle:

$('div').find('p').length; // 3
$('div').children('p').length; // 2

Follow CodeGalaxy

Mobile Beta

Get it on Google Play
Send Feedback