August 2013
Beginner
70 pages
1h 26m
English
So far I've mentioned vaguely something called context that can be used during a selection. This recipe illustrates how and why we use the second parameter of jQuery, context.
Our goal is to apply a border to all of the <li> descendants of an element having ID content, using the context parameter. Perform the following steps:
child-filters.html file and rename it as context-matters.html.<head> section of the page adding this code:<script>
$(document).ready(function() {
$('li', '#content').css('border', '2px solid #000000');
});
</script>This recipe is very simple because I want you to focus on the consequences ...
Read now
Unlock full access