Mumpitz is a jQuery-like wrapper class for DOM elements.
The API focuses on modern browser-technologies and does not provide fallbacks/polyfills.
Everything should work as expected. But there are no tests ... so "expected" is undefined and may vary.
(This is not a serious project and intended as a joke)
Copyright (c) 2018 asccc
See license
src/mumpitz.js ES2016
dist/mumpitz.js ES2015
Searches for elements matching the given selector. A new instance of the internal Mumpitz wrapper class is returned.
If an instance of Mumpitz is passed as selector
, the passed context
gets ignored and
the instance gets returned as-is.
Returns the previous value stored in $ before the Mumpitz-library was loaded.
Exported prototype of the internal Mumpitz wrapper class. Use this object to extend Mumpitz.
The collection of nodes.
The length of the collection.
Iterate over the collection using a for-of loop.
Returns the element at the given index.
If index
is null, the complete collection is returned (be aware, the collection is a NodeList and not an Array!).
if index
is less than 0, the offset starts from the end of the collection (e.g. offset = length + index).
If the computed offset is out of bounds (e.g. still less than 0
or greater than or equal to length
) an Error
is thrown.
Returns true if the first element in the collection matches the given selector.
Searches for elements using the first element in the collection as context. Equivalent to Mumpitz(selector, this.get(0))
.
Iterates over the collection. Note there is also a jQuery-likeeach(callback)
method.
Checks if the first element in the collection has the given class-name.
Removes the given class-name from all elements in the collection.
Adds the given class-name to all elements in the collection.
Toggles the given class-name in all elements in the collection.