HTML:
<div class="buttons"> <button>Boston</button> <button>Acapulco</button> </div> <div class="tables"> <img src="images/boston.jpg" id="image1"> <img src="images/acapulco.jpg" id="image2"> </div> It is necessary that by clicking on the button you get 1 picture corresponding to the button. How to do this with this, so as not to write a separate code for each picture, if there are 100?
The maximum that I got (but still wrong):
$('button').on('click', function(){ $((this).'img').css('display','block'); });