0

In IE browser alone, set the attribute element is not working using j query. Is there any alternative way to set the attribute using j query or java script. See the below snippet which is not working in IE alone.

obj_KLImages.each(function(){
$(this).attr('src', ishttpHead($(this).attr('longdesc')));
});

1 Answers1

0

You can try using the prop() function instead of attr().

obj_KLImages.each( function() {
  $(this).prop('src', ishttpHead($(this).prop('longdesc')));
});

You can check this thread for a discussion of when to you prop() and attr().

Community
  • 1
  • 1
Elmer
  • 809
  • 9
  • 15