#244 bug
John-David Dalton

Element#adjacent can select siblings childnodes and shouldn't

Reported by John-David Dalton | July 28th, 2008 @ 06:28 AM | in After 1.7

Here is a test that shows that Element#adjacent can select siblings childnodes.

I have attached a patch to fix that.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/...">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<script src="prototype.js" type="text/javascript"></script>
<script type="text/javascript">
  document.observe('dom:loaded', function() {
    alert($('nyc').adjacent('li a'));


<ul id="cities">
  <li class="us" id="nyc">New York</li>
  <li class="uk" id="lon">London</li>
  <li class="us" id="chi">Chicago</li>
  <li class="jp" id="tok">Tokyo</li>
  <li class="us" id="la">
    <a href="http://www.google.com">Los Angeles</a>
  <li class="us" id="aus">Austin</li>


Comments and changes to this ticket

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป

The Prototype JavaScript library.

Shared Ticket Bins


Referenced by