Question: I have this DOM tree:

```
<li> 
data ....
  <br>
  data ...
  <img ... />
  <br>
  <script> ... </script>
  <span> data ... </span>
</li>

```

how can I loop through the children of the above li element that fall between the li itself and script element, i.e. script and span elements are out of the loop ...
thanks in advace !!

note: I do not want to use JQuery, because my app is using Protoype and it will conflict with JQuery if I use both of them together, i'd appreciate it if there's a quick solution using Prototype.

Answer: 
You could use jQuery selectors:

Get all children of `<li>`:

```
$('li').children();

```

Exclude unwanted elements:

```
$('li').children().not('script').not('span');

```

Then loop over the selection:

```
$('li').children().not('script').not('span').each(function(index, element){
    //do sth like hide the element
    $(element).hide();
});

```
here's a solution i hacked for you :

```
    $( "li" ).each(function( index ) {
 console.log($(this).find("span:first").text());
});

```

[first span in Li](http://jsfiddle.net/3AjuG/)