How jQuery parses the DOM

How jQuery parses the DOM


In the context of a web page with many div tags and some having a class of "changethis" as in:


If I wanted to change the text appearing inside of these as in:

<div class="changethis">This text</div>


<div class="changethis">Hello</div>

I would use $("div.changethis).text('Hello');

So using this context and the .text method, the question is:

How does jQuery ( under the hood ) parse each node to find what to change and what not to change.

Is it an iterative process that jQuery uses or a recursive process?