Skip to main content

Bug Tracker

Side navigation

#12810 closed feature (plugin)

Opened October 30, 2012 10:26AM UTC

Closed October 30, 2012 02:49PM UTC

Introduction of doesExist, or exists in jQuery Core

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


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:

Attachments (0)
Change History (1)

Changed October 30, 2012 02:49PM UTC by dmethvin comment:1

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.