How to reset or remove from tag img
attribute src
via JS?
on the theory that it removes:
serviceessite.innerhtml = "";
thought it was also working, but no:
servicesico.src = '';
That is, I have a function that adds the SRC tag from the massif:
let s_names = [
{Site: 'img / logo.svg'},
{Site: 'img / logo-2.svg'},
]
He simply adds it to the past src
and the picture for the second time is not visible when entering, because in SRC
Belebere, and therefore I want to somehow click on Delete button from src
or src
yourself from img
.
I begin.
Answer 1, Authority 100%
You can try RemoveAttribute
Try
servicesico.removeattribute ("src"); // If in Servicesico IMG object