HCLTech interview question

write a code for a custom show/hide function?