Skip to content

Instantly share code, notes, and snippets.

@purplecandy
Last active May 10, 2019 15:35
Show Gist options
  • Save purplecandy/02e27326c073de360f14bb9a9726f1c9 to your computer and use it in GitHub Desktop.
Save purplecandy/02e27326c073de360f14bb9a9726f1c9 to your computer and use it in GitHub Desktop.
Input test
<!-- Copyright 2015 the Dart project authors. All rights reserved.
Use of this source code is governed by a BSD-style license
that can be found in the LICENSE file. -->
<h2>Listening to input</h2>
<br>
<p>Enter text to echo:</p>
<input type="text">
<p id="output"></p>
// Copyright 2012 the Dart project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license
// that can be found in the LICENSE file.
import 'dart:html';
void main() {
var output = querySelector('#output');
InputElement input = querySelector('input');
input.onKeyUp.listen((event){
// print(input.value);
output.innerHtml = input.value;
});
}
/* Copyright 2015 the Dart project authors. All rights reserved. */
/* Use of this source code is governed by a BSD-style license */
/* that can be found in the LICENSE file. */
input {
width: 250px;
margin-left: 2em;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment