+ 2
WEB, please help
Guys please tell me. In Jquery, you can write a function like $ ("# id"). Css ("font-size", "150%"). This function changes the code for the css element, how can I change the current in html <img src = "" id = "test" />. There is an array var box = ["link1", "link2"]. How can I change <img src = "" id = "test" /> namely src = "" By the method of substituting links from an array in js
4 Réponses
+ 4
You want to change value of attribute src?
if that is what you want then the attr() method can be used.
it takes 2 arguments, attribute and value.
e.g. : $("#id").attr("width", "500px");
+ 4
Can you show me code please? Then I can help better
+ 1
🐼 Coding Panda 🐼 I just want to reuse pictures with an array
+ 1
🐼 Coding Panda 🐼 Ok let's get in hp