How to close rogue JavaScript popup window on iPad Safari

The other day my daughter’s Safari browser on her iPad was stuck because she couldn’t close one of the tabs. It was some bogus web site with a popup message that said she had contracted a virus and to call a certain phone number so they can help troubleshoot. At first I thought she had gotten some malware or even actually...