| Index: recipes/web/html/scoped_selectors.html
|
| diff --git a/recipes/web/html/scoped_selectors.html b/recipes/web/html/scoped_selectors.html
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..b1313d887f33475ceb2f53f47da1e7890ee39ff3
|
| --- /dev/null
|
| +++ b/recipes/web/html/scoped_selectors.html
|
| @@ -0,0 +1,26 @@
|
| +<!DOCTYPE html>
|
| +
|
| +<html>
|
| + <body>
|
| + <table>
|
| + <tr><td>Jose</td><td class='status'>Accepted</td></tr>
|
| + <tr><td>Marie</td><td class='status'>Accepted</td></tr>
|
| + <tr><td>Kwame</td><td class='status'>Accepted</td></tr>
|
| + <tr><td>Rohan</td><td class='status'>Accepted</td></tr>
|
| + </table>
|
| +
|
| + <script type="application/dart">
|
| + import 'dart:html';
|
| +
|
| + void main() {
|
| + queryAll('tr').forEach((element) {
|
| + element.onClick.listen((event) {
|
| + var record = event.currentTarget.query('.status');
|
| + record.innerHtml = record.innerHtml == 'Accepted' ? 'Declined' : 'Accepted';
|
| + });
|
| + });
|
| + }
|
| + </script>
|
| + <script src="packages/browser/dart.js"></script>
|
| + </body>
|
| +</html>
|
|
|