Created
August 12, 2022 04:28
-
-
Save RileySeaburg/43baf851ad55d3aaae37044d772f217a to your computer and use it in GitHub Desktop.
Dart Print Form Input
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<form> | |
<h4>Guess the Word<h4> | |
<input/> | |
<button>Guess</button> | |
<div id="error" ></div> | |
</form> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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)); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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