Skip to content

Latest commit

 

History

History
34 lines (25 loc) · 653 Bytes

README.md

File metadata and controls

34 lines (25 loc) · 653 Bytes

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");