Infosys interview question

Write a code to handle alert?