Toggling a checkbox is the default action of clicking on a checkbox. The preventDefault() method prevents this from happening.