<div class="building1">click</div>

<div class="lol1" id="lol1">lol1</div>
<div class="lol2" id="lol2">lol2</div>
var el1 = $('.lol1'),
		el2 = $('.lol2');

$('.building1').on('click', function(event) {
	$(el1).attr('id') ? $(el1).removeAttr('id') : $(el1).attr('id', 'lol1');
	$(el2).attr('id') ? $(el2).removeAttr('id') : $(el2).attr('id', 'lol2');
	// etc.
});

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

  1. https://cdnjs.cloudflare.com/ajax/libs/jquery/3.4.1/jquery.min.js