Links with no href attribute shouldn't cause a 404

A 3rd party script I'm using  [Chosen](http://harvesthq.github.io/chosen/) generates an `a` element without a `href` attribute, which causes a 404 when clicked unless we check for `href.length` in the onclick handler. Seems like a generally good idea to include this check.