In general, when dealing with any HTML element, I usually request the HTML element first:
InputElement myElement = document.query(
Then use some kind of event to capture the value contained in this element:
int val = Math.parseInt(myElement.value);
So, for example, in HTML, I could have an input element of a range of types:
<input id="mySlider" type="range" min="1000" max="10000" step="20" value="5000" />
In Dart, I would capture the value of this slider using the mouse up event:
InputElement mySlider = document.query('#mySlider');
mySlider.on.mouseUp.add((e) {
int _val = Math.parseInt(mySlider.value);
document.query('#status').innerHTML = "$_val";
});
: M1 as. HTML :
<p id="text">This is some text</p>
, :
String str = (query('#text') as ParagraphElement).text;