3/29/2018 - 1:50 PM

Press The Button

Press The Button

import 'dart:html';

main() {

sayHello(MouseEvent event) {
  querySelector("#name").text = (querySelector("#name_box") as InputElement).value;
  (querySelector("#name_box") as InputElement).value = "";

// Follow the instructions on the button

// If you get an error msg, it's just it again.
<!DOCTYPE html>
      <meta charset="utf-8">
      <title>Hello World - Fancy Example</title>
      <link rel="stylesheet" href="helloworldfancy.css">
      <h1>Hello, <span id="name"></span></h1>
      <input type="text" id="name_box">
      <input type="submit" value="Type your name, then click this button:" id="button">
      <script type="application/dart" src="helloworldfancy.dart"></script>
      <script src="packages/browser/dart.js"></script>