Learn Javascript, toggle, Javascript and the DOM, Codecademy

Lesson Summary

In this javascript lesson we learn how to combine the .hide method, and the .show method. This can simply be done with the .toggle method in javascript. The toggle method in javascript allows us to show and hide eleements on a page depending if their display property is hidden or not. This is a great method to use when wanting to show or hide elements on your page depending on an event such as a button click.