<html>
<head>
<title>jQuery Custom Selector Test</title>
<script type="text/javascript" src="jquery-latest.pack.js"></script>
<script type="text/javascript">
jQuery.extend(
jQuery.expr[ ":" ],
{
hottie : (
"jQuery( a ).attr( 'rel' ) == 'girl' && " +
"jQuery( a ).attr( 'hotness' ) >= 9"
)
}
);
function FindHotties(){
$( "ol a:hottie" ).css( "font-weight", "bold" );
}
</script>
</head>
<body>
<ol>
<li><a rel="girl" hotness="9.0">Sarah</a></li>
<li><a rel="girl" hotness="8.0">Libby</a></li>
<li><a rel="girl" hotness="9.0">Azure</a></li>
<li><a rel="girl" hotness="8.5">Cindy</a></li>
</ol>
<p>
<a href="javascript:void(0);"
onclick="FindHotties();"
>Find Hotties</a>
</p>
</body>
</html>