jQuery-like API for web-sys

docs.rs Build Status License

jQuery is dead and everyone agrees that you should use a modern approach like React instead (or, in the Rust/WASM world, Yew).

web-sys-query allows you to port simple jQuery applications to Rust/WASM with a familiar API instead of the rather complex web-sys DOM API.

TODO

API

Attributes

| jQuery: Attributes | Document | Element + Collection | | -------------------- | --------------- | ------------------------------ | | .addClass() | | addclass | | .attr() | | attr, setattr | | .hasClass() | | hasclass | | .html() | | html, sethtml | | .prop() | | | | .removeAttr() | | removeattr | | .removeClass() | | removeclass | | .removeProp() | | | | .toggleClass() | | toggleclass | | .val() | | val, setval, *i32, *f64 |

Events

| jQuery: Attributes | Document | Element + Collection | | -------------------- | --------------- | ------------------------------ | | ~.bind()~ | | | | .blur() | | blur, setblur | | .change() | | change, setchange | | .click() | | click, setclick | | .contextmenu() | | contextmenu, setcontextmenu | | .dblclick() | | dblclick, setdblclick | | ~.delegate()~ | | | | ~.die()~ | | | | ~.error()~ | | | | .focus() | | focus, setfocus | | .focusin() | | | | .focusout() | | | | .hover() | | | | .keydown() | | keydown, setkeydown | | .keypress() | | keypress, setkeypress | | .keyup() | | keyup, setkeyup | | ~.live()~ | | | | .load() | | | | .mousedown() | | mousedown, setmousedown | | .mouseenter() | | mouseenter, setmouseenter | | .mouseleave() | | mouseleave, setmouseleave | | .mousemove() | | mousemove, setmousemove | | .mouseout() | | mouseout, setmouseout | | .mouseover() | | mouseover, setmouseover | | .mouseup() | | mouseup, setmouseup | | .off() | | setoff | | .on() | | on, seton | | .one() | | | | .ready() | | | | .resize() | | resize, setresize | | .scroll() | | scroll, setscroll | | .select() | | select, setselect | | .submit() | | submit, setsubmit | | ~.toggle()~ | | | | .trigger() | | | | .triggerHandler() | | | | ~.unbind()~ | | | | ~.undelegate()~ | | | | ~.unload()~ | | |

Manipulation

| jQuery: Traversing | Document | Element + Collection | | -------------------- | --------------- | ------------------------------ | | .after() | | | | .append() | | | | .appendTo() | | | | .before() | | | | .clone() | | | | .css() | | | | .detach() | | | | .empty() | | | | .height() | | | | .innerHeight() | | | | .innerWidth() | | | | .insertAfter() | | | | .insertBefore() | | | | $.cssNumber | | | | $.htmlPrefilter() | | | | .offset() | | | | .outerHeight() | | | | .outerWidth() | | | | .position() | | | | .prepend() | | | | .prependTo() | | | | .remove() | | | | .replaceAll() | | | | .replaceWith() | | | | .scrollLeft() | | | | .scrollTop() | | | | .text() | | text, set_text | | .unwrap() | | | | .width() | | | | .wrap() | | | | .wrapAll() | | | | .wrapInner() | | |

Traversing

| jQuery: Traversing | Document | Element + Collection | | -------------------- | --------------- | ------------------------------ | | .add() | | | | .addBack() | | | | ~.andSelf()~ | | | | .children() | children | children | | .closest() | | closest | | .contents() | | | | .each() | | | | .end() | | | | .eq() | | | | .even() | | | | .filter() | | filter | | .find() | find | find | | .first() | | first | | .has() | | has | | .is() | | is | | .last() | | last | | .map() | | | | .next() | | next | | .nextAll() | | | | .nextUntil() | | | | .not() | | not | | .odd() | | | | .offsetParent() | | | | .parent() | | parent | | .parents() | | | | .parentsUntil() | | | | .prev() | | prev | | .prevAll() | | | | .prevUntil() | | | | .siblings() | | | | .slice() | | |

Copyright and license

Licensed under an OpenBSD-ISC-style license, see LICENSE for details.