I think you can shorten `$("#a").hide(); $("#b").hide();` to `$("#a, #b").hide();`