Data Selector 1.1

Data Selector, originally covered by James Padolsey, and later extended by Pim Jager's data selector, provides an even more enhanced filter for values stored using jQuery's .data() method. It uses comparison operators and methods to match the elements specified, as well as the ability to add special comparison functions.

I've created a quick testing environment below so you can see how it works. I've also included the test suite used when building the plugin so developers can test their special comparison functions as they want.

Test Zone

  • Option 0
  • Option 1
  • Option 2
  • Option 3


$list.filter(':data()')

Examples

Data on each option:

Option 0: {
	even: true
}
Option 1: {
	odd: true,
	noval: true
}
Option 2: {
	even: true,
	singleval: 'testcase',
	falseval: false
}
Option 3: {
	odd: true,
	tree: {
		lvl1: {
			lvl2: {
				fin: 22
			}
		}
	}
}

Be sure to check out the docs for further documentation, and don't be afraid to mail me with any questions or bugs.