Skip to content

Instantly share code, notes, and snippets.

@RileySeaburg
Created August 12, 2022 04:28
Show Gist options
  • Save RileySeaburg/43baf851ad55d3aaae37044d772f217a to your computer and use it in GitHub Desktop.
Save RileySeaburg/43baf851ad55d3aaae37044d772f217a to your computer and use it in GitHub Desktop.
Dart Print Form Input
<form>
<h4>Guess the Word<h4>
<input/>
<button>Guess</button>
<div id="error" ></div>
</form>
import 'dart:html';
void main() {
final InputElement input = querySelector("input") as InputElement;
final DivElement div = querySelector('#error') as DivElement;
/// Dynamically Print User Input
input.onInput.listen((dynamic event) => print(event.target.value));
}
h4 {
color: white;
}
form{
display: flex;
flex-direction: column;
}
#error {
color: red;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment