Finding elements and changing their attributes
All web apps import the Dart library
dart:html
; this is a huge collection of functions and classes needed to program the DOM (look it up at api.dartlang.org). Let's discuss the base classes, which are as follows:
- The
Navigator
class contains info about the browser running the app, such as the product (the name of the browser), its vendor, the MIME types supported by the installed plugins, and also the geolocation object. - Every browser window corresponds to an object of the
Window
class, which contains, amongst many others, anavigator
object, theclose
,print
,scroll
andmoveTo
methods, and a whole bunch of event handlers, such asonLoad
,onClick
,onKeyUp
,onMouseOver
,onTouchStart
, andonSubmit
. Use an alert to get a pop-up message in the web page, such as intodo_v2.dart
:window.onLoad.listen( (e) => window.alert("I am at your disposal") );
- If your browser has tabs, each tab opens in a separate window. From the...