Поэтому я хочу, чтобы я нажимал другую кнопку. отключенная кнопка становится активной
Кнопка «Нравится» 1 была нажата и отключена.
при нажатии другой кнопки, как кнопка 3, кнопка 1 становится активной
как будто 1 нажат и отключен, затем, когда 2 нажат и отключен, тогда 1 включается Вот так
Код: Выделить всё
$(function () {
$("#button1").click(function () {
$("#button1").prop("disabled", true);
$("p").text("You have clicked on Button 1");
$(this).text("Selected");
});
$("#button2").click(function () {
$("#button2").prop("disabled", true);
$("p").text("You have clicked on Button 2");
$(this).text("Selected");
});
$("#button3").click(function () {
$("#button3").prop("disabled", true);
$("p").text("You have clicked on Button 3");
$(this).text("Selected");
});
$("#button4").click(function () {
$("#button4").prop("disabled", true);
$("p").text("You have clicked on Button 4");
$(this).text("Selected");
});
});Код: Выделить всё
Button 1
Button 2
Button 3
Button 4
Подробнее здесь: https://stackoverflow.com/questions/785 ... nother-one
Мобильная версия