Skip to main content

Bug Tracker

Side navigation

Ticket #4629: enabledSelector.html
File enabledSelector.html, 1.1 KB (added by rnspiller, May 06, 2009 03:42PM UTC)

Test Case

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
<title>Enabled Selector</title>
<style type="text/css">
p a {
	margin-left: 1em;
}
p#output{
	border: 1px #cccccc solid;
}
</style>
</head>
<body>
	<p>
		<a class="someClass" href="#">Enabled Link 1</a>
		<a class="someClass" href="#">Enabled Link 2</a>
		<a class="someClass" disabled="disabled">Disabled Link 1</a>
		<a class="someClass" disabled="disabled">Disabled Link 2</a>
	</p>
	<p id="output"></p>
	<script src="scripts/jquery.min.js" type="text/javascript"></script>
	<script type="text/javascript">
	    //<![CDATA[
	    $(function() {
	    	$('#output').html('Total Links: ' + $('a.someClass').length + '<br />' + 
		    				  'Enabled Links: ' + $('a.someClass:enabled').length + '<br />' + 
							  'Disabled Links: ' + $('a.someClass:disabled').length);
	    });
	    //]]>
	</script>
</body>
</html>

Download in other formats:

Original Format