Hi there,
I'm trying to understand web_sys
, but I got stuck. For some html-page with
<textarea id="your_message"></textarea>
I want to get the data of the texatarea. I can get the Element
:
let window = web_sys::window().expect("no global `window` exists");
let document = window.document().expect("should have a document on window");
let your_message = document.get_element_by_id("your_message").unwrap();
But now I'm stuck. If I use your_message.value_of()
, I get an Object
, and I don't know how to handle that. In the ideal case, I would like to get an HtmlTextAreaElement
, and then use value()
on that. Does anybody know what I'm missing here?
Thanks in advance,
Linus