Новый курс! Каждый программист должен знать генеративный ИИ!
Попробуйте бесплатный урок0
What is the code for toggle button?
when you click on button it should show other button like book unbook type
5 ответов
+ 7
var button = document.getElementById("button-id");
button.addEventListener("click", function(){
if (button.classList.contains("unbook")){
button.classList.remove("unbook");
} else {
button.classList.add("unbook");
}
});
All you need is to specify #button-id.unbook style in CSS
+ 2
More descriptive question please.
0
More details please.
0
Here you go...
https://code.sololearn.com/WRD8Q1yqtHRc/?ref=app