WEB, please help | Sololearn: Learn to code for FREE!
Nouvelle formation ! Tous les codeurs devraient apprendre l'IA générative !
Essayez une leçon gratuite
+ 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

29th Nov 2019, 12:45 PM
No Activity
No Activity - avatar
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");
29th Nov 2019, 12:53 PM
Raj Chhatrala
Raj Chhatrala - avatar
+ 4
Can you show me code please? Then I can help better
29th Nov 2019, 1:07 PM
Raj Chhatrala
Raj Chhatrala - avatar
+ 1
🐼 Coding Panda 🐼 I just want to reuse pictures with an array
29th Nov 2019, 1:06 PM
No Activity
No Activity - avatar
+ 1
🐼 Coding Panda 🐼 Ok let's get in hp
29th Nov 2019, 1:09 PM
No Activity
No Activity - avatar