updated to avoid using jQuery ~ per Michael Dale.