How to switch a div background image in jQuery

To switch a div background image in jQuery you can use the following snippet.

Sample jQuery

$("#myImageId").attr("src","newImage.jpg");

Please Share us:
Please rate this snippet

3 thoughts on “How to switch a div background image in jQuery

Leave a Reply