Добавил возможность смены картинки при нажатии на картинку

This commit is contained in:
B4D_US3R 2024-12-14 15:58:59 +05:00
parent 9dbcc53fd1
commit 0d782ec32e
5 changed files with 1051 additions and 8 deletions

View file

@ -1,7 +1,9 @@
import axios from "axios";
let pictureId = document.getElementById("CatGirlPicture")
let pictureId = document.getElementById("CatGirlPicture");
pictureId.onclick = function() {
let picFilename = axios.get(location.href + "rand")
console.log(picFilename)
axios.get(location.href + "rand").then(function (response) {
console.log(response.data)
document.getElementById("CatGirlPicture").setAttribute("src", "images/"+response.data);
});
}