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

Side by Side 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, 7 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 unified diff | Download patch
OLDNEW
(Empty)
1 <!DOCTYPE html>
2 <head>
3 <style>
4 .out-of-stock {color: #aaa};
5 </style>
6 </head>
7 <html>
8 <body>
9 <ul>
10 <li>Selection:
11 <ul>
12 <li>Toyota
13 <ul>
14 <li>Prius</li>
15 <li class='out-of-stock'>Camry Hybrid</li>
16 <li>Rav 4</li>
17 </ul>
18 </li>
19
20 <li>Honda
21 <ul>
22 <li class='out-of-stock'>Civic</li>
23 <li>Accord</li>
24 </ul>
25 </li>
26
27 <li>Nissan
28 <ul>
29 <li>Altima</li>
30 <li class='out-of-stock'>Pathfinder</li>
31 </ul>
32 </li>
33 </ul>
34 </li>
35 </ul>
36
37 <p><a href='#'>Show only in-stock</a></p>
38
39 <script type="application/dart">
40
41 import 'dart:html';
42
43 void main() {
44
45 query('a').onClick.listen((event) {
46 queryAll('.out-of-stock').forEach((item) {
47 item.remove();
48 });
49
50 event.preventDefault();
51 event.stopPropagation();
52 event.target.remove();
53 });
54 }
55
56 </script>
57 <script src="packages/browser/dart.js"></script>
58 </body>
59 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698