Skip to content

Add to the set of matched elements if the current set is empty.

Notifications You must be signed in to change notification settings

fortnightlabs/jquery-or

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 

Repository files navigation

jquery.or

Add to the set of matched elements if the current set is empty. Useful for specifying a fallback or base case to still act upon.

Examples:

// tr.last, failing that just the last tr then.
$('tr.last').or('tr:last').toggle();

// find the closest parent form, but fall back to the target otherwise.
$(e.target).closest('form').or(e.target);

About

Add to the set of matched elements if the current set is empty.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published