Converting NodeList to Array and added attachEvent IE8