Permalink
Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
34 lines (25 sloc) 514 Bytes
<!doctype html>
<html lang="en">
<head>
<title>JavaScript Patterns</title>
<meta charset="utf-8">
</head>
<body>
<script>
/* Title: Universal Selector
* Description: better use of universal selector
*/
// antipattern 1
$('.buttons > *')
// preferred 1
$('.buttons').children()
// antipattern 2
$('.gender :radio')
$('.gender *:radio')
// preferred 2
$('.gender input:radio')
// References
// http://paulirish.com/2009/perf/
</script>
</body>
</html>