Last active
December 19, 2015 15:20
-
-
Save inoh/5975941 to your computer and use it in GitHub Desktop.
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
Dart | |
import 'dart:html'; | |
InputElement testInput; | |
UListElement testList; | |
ButtonElement testDelete; | |
void main() { | |
testInput = query("#test-input"); | |
testList = query("#test-list"); | |
testDelete = query("#delete-all"); | |
testInput.onChange.listen(addList); | |
testDelete.onClick.listen(deleteAll); | |
} | |
void addList(Event e) { | |
var newList = new LIElement(); | |
newList.text = testInput.value; | |
testInput.value = ""; | |
testList.children.add(newList); | |
} | |
void deleteAll(Event e) { | |
testList.children.clear(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
HTML