Infosys Interview Question

Write a code to handle alert?