HCLTech Interview Question

write a code for a custom show/hide function?