0

i am clicking on an image and then displaying some message but after click on the ok on alert i want my image to change i am using mvc structure and html is in angular js

i tried like this

alert(response);

$('.Opaque_commentWindow_add').addClass('hide');

$(event.target).closest('.contDivs').find('.commentImage').addClass('.display');

1.first alert

2.second click on ok the overlay window gets closed

3.but third line doesnt works for changing the image on which clicked

Pete
  • 57,112
  • 28
  • 117
  • 166

2 Answers2

1

In you posted code, i noticed only this error:

$(event.target).closest('.contDivs').find('.commentImage').addClass('display');
//----remove the dot from here---------------------------------------^
Jai
  • 74,255
  • 12
  • 74
  • 103
0

You can use:

[object].style.backgroundImage="url('URL')" 

where [object] is the element of which you want to change the background image.

The Codesee
  • 3,714
  • 5
  • 38
  • 78
MWT
  • 172
  • 3
  • 11
  • you can use the display properties same like that... [object].style.display="none"; – MWT Jul 08 '14 at 04:17