Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(63)

Unified Diff: recipes/web/html/removing.html

Issue 14109034: Recipes for using CSS Selectors with dart:html (Closed) Base URL: https://github.com/dart-lang/cookbook.git@master
Patch Set: Removed unwanted file. Created 7 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: recipes/web/html/removing.html
diff --git a/recipes/web/html/removing.html b/recipes/web/html/removing.html
new file mode 100644
index 0000000000000000000000000000000000000000..af6c6a12f13d9e4d260c7f8f6aa7d402b955eb72
--- /dev/null
+++ b/recipes/web/html/removing.html
@@ -0,0 +1,59 @@
+<!DOCTYPE html>
+<head>
+ <style>
+ .out-of-stock {color: #aaa};
+ </style>
+</head>
+<html>
+ <body>
+ <ul>
+ <li>Selection:
+ <ul>
+ <li>Toyota
+ <ul>
+ <li>Prius</li>
+ <li class='out-of-stock'>Camry Hybrid</li>
+ <li>Rav 4</li>
+ </ul>
+ </li>
+
+ <li>Honda
+ <ul>
+ <li class='out-of-stock'>Civic</li>
+ <li>Accord</li>
+ </ul>
+ </li>
+
+ <li>Nissan
+ <ul>
+ <li>Altima</li>
+ <li class='out-of-stock'>Pathfinder</li>
+ </ul>
+ </li>
+ </ul>
+ </li>
+ </ul>
+
+ <p><a href='#'>Show only in-stock</a></p>
+
+ <script type="application/dart">
+
+ import 'dart:html';
+
+ void main() {
+
+ query('a').onClick.listen((event) {
+ queryAll('.out-of-stock').forEach((item) {
+ item.remove();
+ });
+
+ event.preventDefault();
+ event.stopPropagation();
+ event.target.remove();
+ });
+ }
+
+ </script>
+ <script src="packages/browser/dart.js"></script>
+ </body>
+</html>

Powered by Google App Engine
This is Rietveld 408576698