Neater solution for newer browsers