Skip to main content

Bug Tracker

Side navigation

#1271 closed bug (fixed)

Opened June 06, 2007 07:58AM UTC

Closed May 13, 2008 12:34AM UTC

attribute in FORM?

Reported by: achun Owned by: john
Priority: major Milestone: 1.2.2
Component: core Version: 1.2.1
Keywords: Cc:
Blocked by: Blocking:
Description

html code:

<div foo='defineattribute'></div>
<form>
<input name='foo'>
</form>

js code:

$('[@act]').each(function(){
//code
});

I want cat DIV only,but FORM ........

Of course . fixed js code:

$('[@act]').each(function(){
if ('FORM'==this.tagName) return;//Trouble.......
//code
});
Attachments (1)
  • test1271.diff (1.0 KB) - added by joern December 06, 2007 09:01PM UTC.

    Test

Change History (4)

Changed June 06, 2007 08:01AM UTC by achun comment:1

sory!

$('[@foo]').each(function(){
//code
});
$('[@foo]').each(function(){
if ('FORM'==this.tagName) return;//Trouble.......
//code
});

Changed July 20, 2007 07:34PM UTC by john comment:2

milestone: 1.1.31.1.4
owner: → john
version: 1.1.21.1.3

Changed December 06, 2007 09:01PM UTC by joern comment:3

milestone: 1.1.41.2.2
need: ReviewPatch
version: 1.1.31.2.1

Changed May 13, 2008 12:34AM UTC by flesler comment:4

resolution: → fixed
status: newclosed

Although this case is now improved, .attr() will still return the element if no attribute is found.

That means that if do add a foo attribute to the form, at least empty, it will work as expected.