To change the src attribute of an image using jQuery, you can use the .attr() function. Here's an example:

// Get the image element by its ID
var image = $("#imageId");

// Change the src attribute
image.attr("src", "new_image.jpg");

In the above example, replace "imageId" with the actual ID of your image element, and "new_image.jpg" with the path or URL of the new image you want to set.

change img attr src by jquery

原文地址: https://www.cveoy.top/t/topic/hM5L 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录