Tray.ai interview question

Implement the getElementsByTagName function