You can use these examples to change img tags src attribute or any attribute of any tag.
The most simple solution is to change image by class or id, this works for first tag with that class:
Source code viewer
<script type="text/javascript"> $('.class').attr('src','image/dir/image-name.png'); </script>Programming Language: Javascript
This code replaces src attributes of all tags with the class name:
Source code viewer
<script type="text/javascript"> $('.class').each(function(){ $(this).attr('src','image/dir/image-name.png'); }); </script>Programming Language: Javascript
This example changes size of all images in a tag which class is declared:
Source code viewer
<script type="text/javascript"> $('.class a').each(function(){ $(this).attr('style','width:150px;'+$(this).attr('style')); }); </script>Programming Language: Javascript