{* *}
code teams

makeToggle



Here's a quick function to configure a section of html that you can toggle by clicking another element.

function makeToggle(trigger, element) {
    trigger.click(function(){
       element.toggle();
    });
    trigger.hover(function(){
       trigger.css("cursor", "pointer");
    },
    function(){
       trigger.css("cursor", "default");
    });
    element.css("display", "none");
    trigger.css("color", "blue");
};

$(document).ready(function(){
    makeToggle($("#div_button"), $("#div_section"));
});

<div id='div_button'>Click Me</div>
<div id='div_section'>This section will be hidden.</div>