Updated with a non-jquery alternative