That is clever! I wish we could use tricks like that but we've never used client side JS for such purposes.
p.s. I've added this comment to https://news.ycombinator.com/highlights. I mention this so more people might learn that it exists and hopefully send us nominations!