I'm attempting to target several duplicate ids such as "img1, img2" in my code, but I haven't had any success. How can I select all the ids that contain the same word without relying on jQuery or any other external libraries?
Below is the code snippet I am using:
var resim = document.getElementById("resim");
var originalWidth = resim.style.width; // stores the original width
document.getElementById("resizeButton").addEventListener("click", function () {
changedivclass();
if (resim.style.width === "100%") {
resim.style.width = originalWidth;
} else {
resim.style.width = "100%";
}
});