Toggle an element

To toggle the element, we update the display property:

const toggle = function(ele) {
const display = ele.style.display;
ele.style.display = display === 'none' ? 'block' : 'none';
};

More

Previous
Swap two nodes
Next
Trigger an event