JQuery src add weird class to IMG
1 answer
$("#element")
returns a jquery object representing the elements matching the selector. In this case, it represents one element. When do you intend to install it srcas follows
$("#element").src = ".....";
you are actually trying to set the attribute of srcthis jquery object. Instead, there are several possible solutions. Examples:
atr
$("#element").attr("src", ".....");
prop
$("#element").prop("src", ".....");
array element
$("#element")[0].src = ".....";
receive
$("#element").get(0).src = ".....";
+3
