Click Me

This is a paragraph block

This is a paragraph block

This is a paragraph block

In lesson #6 you learn how to use the .toggle and .toggleClass commands. As the name suggests, you can turn elements on and off with one command.

For this lesson there are two examples. The first is the link that says "Click Me". The second is to click on one of the sentences above. Try it out!

$(function() {
	$('a').click(function() {
		//$('#box').toggle();
		$('#box').toggleClass('border');
	});	

	$('p').click(function() {
		$(this).toggleClass('highlight');
	});
});
			

You can see all the code by viewing the source of this page (Ctrl-U in most browsers).



Check out the video here.

www.channeleaton.com