#1173 new
mindVex

Selector fails on empty attributes

Reported by mindVex | November 30th, 2010 @ 03:27 PM

Considering the following HTML snippet:

<html>
<head>
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/prototype/1.7.0.0/prototype.js"></script>
</head>
<body>
<div id="test1">
<span title="">not found</span>
</div>
<div id="test2">
<span title="t">found</span>
</div>
</body></html>

Looking at the second div (the only difference is the non-empty title attribute) the following selectors work as expected:

$$('#test2 span[title]') // works
$('test2').select('span[title]') // works
$('test2').select('span') // works

Trying to select the first span with the empty title attribute in various ways results in "undefined" in one case:

$$('#test1 span[title]') // works
$('test1').select('span[title]') // doesn't work - returns "undefined"
$('test1').select('span') // works

So selecting elements with empty attributes seem to fail when using down(), select() and the like. Using $$() works. Tested in Firefox 3.6.12.

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

People watching this ticket

Pages