Newer jQuery.attr returns undefined, handle gracefully