0.1.1 • Published 7 years ago

mu-jquery-if v0.1.1

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

mu-jquery-if

jQuery expression for filtering elements.

Installation

npm install mu-jquery-if
bower install mu-jquery-if

Usage

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

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

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