no need for the `isEmpty` check. `$.fn.attr` handles nullish and empty objects gracefully.