jQuery - toggle()

With jQuery, you can toggle between the hide() and show() methods with the toggle() method. Shown elements are hidden and hidden elements are shown. You can provide the milliseconds as a param. With no parameters, the .toggle() method simply toggles the visibility of elements.

https://api.jquery.com/toggle/

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Quam adipiscing vitae proin sagittis nisl rhoncus mattis rhoncus urna. Adipiscing elit duis tristique sollicitudin nibh sit. Condimentum id venenatis a condimentum vitae sapien pellentesque. Nunc consequat interdum varius sit.


$(document).ready(function()
{
    let delay = 2000;
    $("#ToggleDemoButton").click(function()
    {
        $("#LorumIpsumContent").toggle(2000);
    });
});


// here's another sample - not demonstrated
var $logInToggle = $("#log-in-toggle");
var $popUpForm = $(".pop-up-form");

// toggle is just for show/hide
$logInToggle.on("click", function () { $popUpForm.toggle();});