Skip to content

Instantly share code, notes, and snippets.

@mdecourse
Created September 1, 2019 02:37
Show Gist options
  • Save mdecourse/ef311161ee04fb7b278c01dc591cd392 to your computer and use it in GitHub Desktop.
Save mdecourse/ef311161ee04fb7b278c01dc591cd392 to your computer and use it in GitHub Desktop.
Dartpad and Html
<p id="text1">
origin text
</p>
// https://dart.dev/tutorials/web/low-level-html/connect-dart-html
import 'dart:html';
void main() {
// 選擇將 id 為 text1 的 text 文字設為 "changed"
querySelector("#text1").text = "changed";
}
/*
設定 id 為 text1 標註的 style
*/
#text1 {
font-size: 20px;
font-family: 'Open Sans', sans-serif;
text-align: center;
margin-top: 20px;
background-color: SlateBlue;
color: Yellow;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment