Occasionally clicking the background resulted in this failing
Converting to jQuery attr seems a good idea anyways. For upstream!