#web-sys #jquery


jQuery-like API for web-sys

6 releases

0.0.1-alpha.5 Dec 15, 2020
0.0.1-alpha.4 Dec 11, 2020
0.0.1-alpha.3 Dec 10, 2020
0.0.1-alpha.1 Dec 9, 2020

#661 in WebAssembly

26 downloads per month

ISC license

738 lines

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.


  • Documentation and examples
  • Unit tests
  • AJAX
  • ...

Feature flags

  • serde-serialize: use serde_derive to enable Serialize and Deserialize support on types such as FormData (disabled by default).



jQuery: Attributes Document Element + Collection
.addClass() add_class
.attr() attr, set_attr
.hasClass() has_class
.html() html, set_html
.removeAttr() remove_attr
.removeClass() remove_class
.toggleClass() toggle_class
.val() val, set_val, *_i32, *_f64


jQuery: Attributes Document Element + Collection
.blur() blur, set_blur
.change() change, set_change
.click() click, set_click
.contextmenu() context_menu, set_context_menu
.dblclick() dbl_click, set_dbl_click
.focus() focus, set_focus
.keydown() key_down, set_key_down
.keypress() key_press, set_key_press
.keyup() key_up, set_key_up
.mousedown() mouse_down, set_mouse_down
.mouseenter() mouse_enter, set_mouse_enter
.mouseleave() mouse_leave, set_mouse_leave
.mousemove() mouse_move, set_mouse_move
.mouseout() mouse_out, set_mouse_out
.mouseover() mouse_over, set_mouse_over
.mouseup() mouse_up, set_mouse_up
.off() set_off
.on() on, set_on
.resize() resize, set_resize
.scroll() scroll, set_scroll
.select() select, set_select
.submit() submit, set_submit


jQuery: Traversing Document Element + Collection
.text() text, set_text


jQuery: Traversing Document Element + Collection
.children() children children
.closest() closest
.filter() filter
.find() find find
.first() first
.has() has
.is() is
.last() last
.next() next
.not() not
.parent() parent
.prev() prev

Helper Functions

jQuery: Traversing Document Element + Collection
.serializeArray() serialize_array, FormData

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


~174K SLoC