Showing posts with label How to change image .attr("src") using jquery. Show all posts
Showing posts with label How to change image .attr("src") using jquery. Show all posts

Thursday, 8 October 2015

How should i change image src using jquery


How should i change image src using jquery

<img src="http://chandreshrana.blogspot.com/chand.png" title="chandresh" alt="chandresh" id="bigImg" />

<script type="text/javascript">
  jQuery("#button").click(function(){
var NewImageUrl = "http://chandreshrana.blogspot.com/chandresh.png"
jQuery("#bigImg").attr('src', 'NewImageUrl');
});
</script>