この単純な if/else を機能させるのに少し問題があります。
$(document).ready(function () {
$(".sme").click(function (event) {
var vote = $(this).attr('id');
$('.to').html(vote);
$(".sme").removeClass('clicked');
$(this).addClass('clicked');
});
});
$(document).ready(function () {
$(".tme").click(function (event) {
var more = $(this).attr('id');
$('.more').html(more);
if (typeof vote) {
$('.error').html("ERRRROOORRRR");
} else {
$(".tme").removeClass('clicked');
$(this).addClass('clicked');
}
});
});
if/else の動作に問題があります。
どんな助けでも素晴らしいでしょう、ありがとう!