@nsrosenqvist/jquery.exists

1.0.2 • Public • Published

jQuery Exists

A jQuery plugin to check whether an element exists and if so run the callback on the element.

Installation

npm install @nsrosenqvist/jquery.exists

Usage

$('.maybe-exists').exists(function() {
    $(this).addClass('definitely-exists');
});

if ($('.maybe-exists').exists()) {
    alert('exists');
}

License

MIT

Dependencies (0)

    Dev Dependencies (0)

      Package Sidebar

      Install

      npm i @nsrosenqvist/jquery.exists

      Weekly Downloads

      0

      Version

      1.0.2

      License

      MIT

      Unpacked Size

      2.52 kB

      Total Files

      5

      Last publish

      Collaborators

      • nsrosenqvist