Permalink
Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
29 lines (22 sloc) 512 Bytes
<!doctype html>
<html lang="en">
<head>
<title>JavaScript Patterns</title>
<meta charset="utf-8">
</head>
<body>
<script>
/* Title: Decending from id
* Description: be more specific, better to descend from an id
*/
// antipattern
var arms = $('.container div.robotarm');
// better
var arms = $('#container div.robotarm');
// preferred
var arms = $('#container').find('div.robotarm');
// References
// http://paulirish.com/2009/perf/
</script>
</body>
</html>