Side navigation
#9396 closed feature (wontfix)
Opened May 22, 2011 07:18PM UTC
Closed June 07, 2011 06:53PM UTC
Last modified October 15, 2012 03:53PM UTC
.hasAttr([ element ])
Reported by: | waynepurtonsmith@hotmail.co.uk | Owned by: | |
---|---|---|---|
Priority: | low | Milestone: | 1.7 |
Component: | attributes | Version: | 1.6.1 |
Keywords: | 1.7-discuss | Cc: | |
Blocked by: | Blocking: |
Description
.hasAttr([ element ])
Similar to .hasClass() but with the use of attributes, for example we can check whether an element has an attribute, e.g.
$('#element').hasAttr('someattribute'); // return either true or false
Attachments (0)
Change History (17)
Changed May 22, 2011 07:27PM UTC by comment:1
keywords: | → 1.7-discuss |
---|
Changed May 22, 2011 08:10PM UTC by comment:2
-1, Can be achieved with existing API
Changed May 22, 2011 09:29PM UTC by comment:3
Replying to [comment:2 rwaldron]:
-1, Can be achieved with existing API
But it should be easy but implementing it - what happened to the easy writing? ;)
Changed May 23, 2011 01:07AM UTC by comment:4
description: | .hasAttr([ element ]) \ \ Similar to .hasClass() but with the use of attributes, for example we can check whether an element has an attribute, e.g. \ \ $('#element').hasAttr('someattribute'); // return either true or false → .hasAttr([ element ])\ \ Similar to .hasClass() but with the use of attributes, for example we can check whether an element has an attribute, e.g.\ \ $('#element').hasAttr('someattribute'); // return either true or false |
---|
+0,
Changed May 23, 2011 05:09AM UTC by comment:5
-1, .attr('someattribute') !== undefined works fine.
Changed May 24, 2011 12:40AM UTC by comment:6
component: | unfiled → attributes |
---|---|
description: | .hasAttr([ element ])\ \ Similar to .hasClass() but with the use of attributes, for example we can check whether an element has an attribute, e.g.\ \ $('#element').hasAttr('someattribute'); // return either true or false → .hasAttr([ element ]) \ \ Similar to .hasClass() but with the use of attributes, for example we can check whether an element has an attribute, e.g. \ \ $('#element').hasAttr('someattribute'); // return either true or false |
priority: | undecided → low |
status: | new → open |
Changed May 24, 2011 10:27PM UTC by comment:7
-1, Bytes do not grow on trees you know.
Changed May 30, 2011 08:34PM UTC by comment:8
Replying to [comment:7 dmethvin]:
-1, Bytes do not grow on trees you know.
It wouldn't be that much... god...
Changed May 31, 2011 03:15PM UTC by comment:9
Replying to [comment:8 anonymous]:
Replying to [comment:7 dmethvin]: > -1, Bytes do not grow on trees you know. It wouldn't be that much... god...
Feature request fulfilled: https://gist.github.com/1000671
Changed May 31, 2011 03:42PM UTC by comment:10
Replying to [comment:9 rwaldron]:
Replying to [comment:8 anonymous]: > Replying to [comment:7 dmethvin]: > > -1, Bytes do not grow on trees you know. > > It wouldn't be that much... god... Feature request fulfilled: https://gist.github.com/1000671
That's pretty good. Would be excellent if it was implemented in the jQuery Core. :-)
Changed June 03, 2011 02:11PM UTC by comment:11
description: | .hasAttr([ element ]) \ \ Similar to .hasClass() but with the use of attributes, for example we can check whether an element has an attribute, e.g. \ \ $('#element').hasAttr('someattribute'); // return either true or false → .hasAttr([ element ])\ \ Similar to .hasClass() but with the use of attributes, for example we can check whether an element has an attribute, e.g.\ \ $('#element').hasAttr('someattribute'); // return either true or false |
---|
-1, Not really needed now that .attr("name") returns undefined if it isn't defined.
Changed June 04, 2011 10:15PM UTC by comment:12
-1
Changed June 05, 2011 10:36PM UTC by comment:13
description: | .hasAttr([ element ])\ \ Similar to .hasClass() but with the use of attributes, for example we can check whether an element has an attribute, e.g.\ \ $('#element').hasAttr('someattribute'); // return either true or false → .hasAttr([ element ]) \ \ Similar to .hasClass() but with the use of attributes, for example we can check whether an element has an attribute, e.g. \ \ $('#element').hasAttr('someattribute'); // return either true or false |
---|
-1, Not necessary
Changed June 06, 2011 02:55PM UTC by comment:14
description: | .hasAttr([ element ]) \ \ Similar to .hasClass() but with the use of attributes, for example we can check whether an element has an attribute, e.g. \ \ $('#element').hasAttr('someattribute'); // return either true or false → .hasAttr([ element ])\ \ Similar to .hasClass() but with the use of attributes, for example we can check whether an element has an attribute, e.g.\ \ $('#element').hasAttr('someattribute'); // return either true or false |
---|
-1
Changed June 06, 2011 03:41PM UTC by comment:15
+1, can already do .is( "[someattribte]" ) but this provides good parity with .hasClass()
Changed June 07, 2011 06:53PM UTC by comment:16
milestone: | 1.next → 1.7 |
---|---|
resolution: | → wontfix |
status: | open → closed |
Closing per 1.7 roadmap meeting resolution
Changed October 15, 2012 03:53PM UTC by comment:17
#12732 is a duplicate of this ticket.
Nominating ticket for 1.7 discussion.