Bug Tracker

Opened 7 years ago

Closed 7 years ago

#12810 closed feature (plugin)

Introduction of doesExist, or exists in jQuery Core

Reported by: evilwebdesign@… Owned by:
Priority: undecided Milestone: None
Component: unfiled Version: 1.8.2
Keywords: Cc:
Blocked by: Blocking:

Description

Hy, I know that you can easily check whether an element is available on the dom by checking the length, but if you need to run that statement over and over again, you get kind of annoyed. thats why I created the jQuery doesExist Plugin, which simply returns true or false if the element is available. I know calling this a plugin is a bit oversized, but who cares, I would be totally overwhelmed if you could include this into the core of jQuery.

simple preview: http://evilwebdesign.bplaced.net/doesExist/

Change History (1)

comment:1 Changed 7 years ago by dmethvin

Resolution: plugin
Status: newclosed

The .length property tells you this already, and quite often you don't need even that--just chain away and it will be a no-op if no elements are selected. It could be done as a tiny plugin but isn't suitable for core.

Note: See TracTickets for help on using tickets.