.toggle()
method. It toggles the display of that node. It adds a style display: none;
and display: block
alternatively, with each click.//js
//listen for the button click event
$('.myElemBtn').on('click', function (e) {
$('.myElem').toggle(); // toggle visibility
}