title: when a click is done on an image, how to show description of that image in a div?
body: <p>i am fetching images from a database and showing on the page.
  now i want that, whenever a user clicks on any image, the description to that image should appear in a div. guide me.</p>
  
  <p>this is in the while loop-</p>
  
  <pre><code>&lt;input type="image" src="&lt;?php echo $row_data['image'];?&gt;" id="&lt;?php echo $row_data['name'];?&gt;" onclick="showElement(this.id)" height=97&gt;
  </code></pre>
  
  <p>and the js function-</p>
  
  <pre><code>function showElement(x){
      alert(x);
      var divid=document.getElementById(x);
      divid.style.visibility="visible";
  }
  </code></pre>