문제

Why doesn't the background color change using the following code?:

if ($(".enteredCodeDisplay_1").css("background-color") == "rgb(255, 255, 255)" ) {

    alert ("hi");
    $("enteredCodeDisplay_1").css("background-color", "rgb(235, 46, 34)");

}

Note: i do get the alert and the if statement doesn't run when the color is not rgb(255, 255, 255)

도움이 되었습니까?

해결책

You are missing . on selector class

should be

$(".enteredCodeDisplay_1")

instead of

$("enteredCodeDisplay_1")
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top