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

Side by Side Diff: recipes/web/html/scoped_selectors.html

Issue 14109034: Recipes for using CSS Selectors with dart:html (Closed) Base URL: https://github.com/dart-lang/cookbook.git@master
Patch Set: Changes based on Kathy's comments. 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
« no previous file with comments | « recipes/web/html/replacing_children.html ('k') | recipes/web/html/selector_with_scope.html » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 <!DOCTYPE html>
2
3 <html>
4 <body>
5 <table>
6 <tr><td>Jose</td><td class='status'>Accepted</td></tr>
7 <tr><td>Marie</td><td class='status'>Accepted</td></tr>
8 <tr><td>Kwame</td><td class='status'>Accepted</td></tr>
9 <tr><td>Rohan</td><td class='status'>Accepted</td></tr>
10 </table>
11
12 <script type="application/dart">
13 import 'dart:html';
14
15 void main() {
16 queryAll('tr').forEach((element) {
17 element.onClick.listen((event) {
18 var record = event.currentTarget.query('.status');
19 record.text = record.text == 'Accepted' ? 'Declined' : 'Accepted';
20 });
21 });
22 }
23 </script>
24 <script src="packages/browser/dart.js"></script>
25 </body>
26 </html>
OLDNEW
« no previous file with comments | « recipes/web/html/replacing_children.html ('k') | recipes/web/html/selector_with_scope.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698