showing results for - "how to use text onclick to display images in javascript"
Rupert
08 May 2020
1$('img').click(function () { // on a click
2  if($(this).attr('id') == '1') { // get the id attribute
3    $('#div').html('Image with 1 was clicked'); // write the text
4  } else { // else if
5     // write something else for the 2
6  }
7}