By James

2018-03-13 15:56:06 8 Comments

I have a code where i need to create a href link to the images too. with the following screenshot

i tried it something like this:

$(document).ready(function() {
   var link = $(".car-image").find('li:first').find('a').attr('href');
   var appendtoimg = $('.car-image').closest('.img-responsive') - here i am stuck as i need to add an onclick event so it can work same as like <a> tag


@Dan Raps 2018-03-13 16:00:15

If you're using jquery you can add a click event listener.

$(".car-image").click(function(){ });

Related Questions

Sponsored Content

53 Answered Questions

[SOLVED] How do I check if an element is hidden in jQuery?

38 Answered Questions

[SOLVED] Is there an "exists" function for jQuery?

  • 2008-08-27 19:49:41
  • Jake McGraw
  • 686621 View
  • 2448 Score
  • 38 Answer
  • Tags:   javascript jquery

39 Answered Questions

[SOLVED] Setting "checked" for a checkbox with jQuery?

16 Answered Questions

[SOLVED] Disable/enable an input with jQuery?

25 Answered Questions

[SOLVED] jQuery scroll to element

  • 2011-07-13 09:49:44
  • DiegoP.
  • 2085150 View
  • 1970 Score
  • 25 Answer
  • Tags:   javascript jquery

15 Answered Questions

[SOLVED] "Thinking in AngularJS" if I have a jQuery background?

59 Answered Questions

[SOLVED] How to check whether a checkbox is checked in jQuery?

22 Answered Questions

[SOLVED] How can I refresh a page with jQuery?

32 Answered Questions

[SOLVED] Add table row in jQuery

50 Answered Questions

Sponsored Content