Picnic Website Code Tutorials

jQuery Show Description On Click Tutorial

3/30/2013

View Demo

Using jQuery how to show description on click. Or using jQuery how to replace div on click. 10 out of 10

The JS

$('#one').click(function() {
  $('#description').html('one');
});
$('#two').click(function() {
  $('#description').html('two');
});
/* OR - you could get the images alt attribute and print that out 
$('#one').click(function() {
  var alt = $(this).attr('alt');
  $('div').html(alt);
}); */
		

Sponsors

Top Donators

Friends of Mine