Bug Tracker

Opened 13 years ago

Closed 12 years ago

#1271 closed bug (fixed)

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 (1023 bytes) - added by joern 12 years ago.
Test

Download all attachments as: .zip

Change History (5)

comment:1 Changed 13 years ago by achun

sory!

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

comment:2 Changed 12 years ago by john

Milestone: 1.1.31.1.4
Owner: set to john
Version: 1.1.21.1.3

Changed 12 years ago by joern

Attachment: test1271.diff added

Test

comment:3 Changed 12 years ago by joern

Milestone: 1.1.41.2.2
need: ReviewPatch
Version: 1.1.31.2.1

comment:4 Changed 12 years ago by flesler

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.

Note: See TracTickets for help on using tickets.