1 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> |
---|
2 | <html xmlns="http://www.w3.org/1999/xhtml"> |
---|
3 | <head> |
---|
4 | <meta content="text/html; charset=utf-8" http-equiv="Content-Type" /> |
---|
5 | <title>Enabled Selector</title> |
---|
6 | <style type="text/css"> |
---|
7 | p a { |
---|
8 | margin-left: 1em; |
---|
9 | } |
---|
10 | p#output{ |
---|
11 | border: 1px #cccccc solid; |
---|
12 | } |
---|
13 | </style> |
---|
14 | </head> |
---|
15 | <body> |
---|
16 | <p> |
---|
17 | <a class="someClass" href="#">Enabled Link 1</a> |
---|
18 | <a class="someClass" href="#">Enabled Link 2</a> |
---|
19 | <a class="someClass" disabled="disabled">Disabled Link 1</a> |
---|
20 | <a class="someClass" disabled="disabled">Disabled Link 2</a> |
---|
21 | </p> |
---|
22 | <p id="output"></p> |
---|
23 | <script src="scripts/jquery.min.js" type="text/javascript"></script> |
---|
24 | <script type="text/javascript"> |
---|
25 | //<![CDATA[ |
---|
26 | $(function() { |
---|
27 | $('#output').html('Total Links: ' + $('a.someClass').length + '<br />' + |
---|
28 | 'Enabled Links: ' + $('a.someClass:enabled').length + '<br />' + |
---|
29 | 'Disabled Links: ' + $('a.someClass:disabled').length); |
---|
30 | }); |
---|
31 | //]]> |
---|
32 | </script> |
---|
33 | </body> |
---|
34 | </html> |
---|