0.0.3 • Published 7 years ago

mu-jquery-and v0.0.3

Weekly downloads
1
License
MIT
Repository
github
Last release
7 years ago

mu-jquery-and

jQuery expression for filtering elements.

Installation

npm install mu-jquery-and
bower install mu-jquery-and

Usage

// AMD
require(["jquery", "mu-jquery-and/jquery.and"], function($, and) {
  $.expr[":"].and = and($);
});

// CJS
$.expr[":"].and  = require("mu-jquery-and/jquery.and")($);

// Global
$.expr[":"].and  = window["mu-jquery-and/jquery.and"]($);
// Set the value of last to "Doe" if the value of first is "John" or "Jane"
$("input['name'='last']:and(input[name='first'][value='John'], input[name='first'][value='Jane'])").val("Doe");