Index: recipes/web/html/selector_with_scope.html |
diff --git a/recipes/web/html/selector_with_scope.html b/recipes/web/html/selector_with_scope.html |
new file mode 100644 |
index 0000000000000000000000000000000000000000..dc387cd7185eab25e46a42472b03346120b16d50 |
--- /dev/null |
+++ b/recipes/web/html/selector_with_scope.html |
@@ -0,0 +1,33 @@ |
+<!DOCTYPE html> |
+ |
+<html> |
+ <head> |
+ <title>selector_with_scope</title> |
+ </head> |
+ <ul> |
+ <li class='first'>Item 1</li> |
+ <li>Item 2 |
+ <ul> |
+ <li class='first'>Nested Item 1</li> |
+ <li>Nested Item 2</li> |
+ </ul> |
+ </li> |
+ <li>Item 3</li> |
+ </ul> |
+ |
+ <body> |
+ <p id="text"></p> |
+ <script type="application/dart"> |
+ |
+ import 'dart:html'; |
+ |
+ void main() { |
+ Element element = query('li ul'); |
+ Element first = element.query('.first'); |
+ first.style.color = 'red'; |
+ } |
+ |
+ </script> |
+ <script src="packages/browser/dart.js"></script> |
+ </body> |
+</html> |