Test case details

Preparation Code

<script src="https://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script> <p><ins></ins></p> <article>         <p>A test</p>         <p><ins></ins></p>         <p>This is text</p> </article> <p><ins></ins></p> <article>         <p>A test</p>         <p><ins></ins></p>         <p>This is text</p> </article>   <p><ins></ins></p> <article>         <p>A test</p>         <p><ins></ins></p>         <p>This is text</p>         <article>                 <p>A test</p>                 <p><ins></ins></p>                 <p>This is text</p>                 <article>                         <p>A test</p>                         <p><ins></ins></p>                         <p>This is text</p>                         <article>                                 <p>A test</p>                                 <p><ins></ins></p>                                 <p>This is text</p>                                 <article>                                         <p>A test</p>                                         <p><ins></ins></p>                                         <p>This is text</p>                                         <article>                                                 <p>A test</p>                                                 <p><ins></ins></p>                                                 <p>This is text</p>                                                         <article>                                                                 <p>A test</p>                                                                 <p><ins></ins></p>                                                                 <p>This is text</p>                                                         </article>                                         </article>                                 </article>                         </article>                 </article>         </article> </article>                 <article>         <p>A test</p>         <div>                 <div>                         <div>                                 <p><ins></ins></p>                         </div>                 </div>         </div>         <p>This is text</p> </article>
var $article = $('article');     var article = $article[0];

Test cases

Test #1

var has = $('article').find('ins').length > 0 ? true : false;

Test #2

var has = $article.find('ins').length > 0 ? true : false;

Test #3

var has = $('ins', 'article').length > 0 ? true : false;

Test #4

var has = $('ins', $article).length > 0 ? true : false;

Test #5

var has = $('article ins').length > 0 ? true : false;

Test #6

var has = $('article > ins').length > 0 ? true : false;