DOM manipulation with Rust

Hello! Please tell me what libraries and technologies I should study for manipulation with DOM, that is, analogues of the getElementById, querySelector, appendChild functions, mouse and keyboard events, drag, drop, Range, Selection and other on the client side with Rust? Thanks for attention!

You can't mainuplate the DOM with Rust, only with JavaScript.

Directly manipulating the DOM isn't usually how Rust WASM UI's are done (yew, dioxus, etc.), but if you really want to manipulate the DOM you can use web-sys.

1 Like

To be clear, none of these do any manipulation on the Rust side, they all one way or another just tell JavaScript to do it.

You can manipulate documents with pure Rust with something like html5ever + kuchiki, but this won't be the browser DOM, but a private Rust-only DOM completely invisible to the browser.

2 Likes