Modify judgment logic

The element id in the page either exists or does not exist, and the 
checkbox box has only two states.Unless there is a third case, 
we use else if

Change-Id: I0eb059757104b1ddd9a8758ce8833c51c52a58b6
This commit is contained in:
gaobin 2018-11-27 15:51:15 +08:00
parent 212d08ae6e
commit 705efb493c
1 changed files with 1 additions and 1 deletions

View File

@ -21,7 +21,7 @@ $(document).ready(function() {
// check value of cookies and set state to the related element
if ($.cookie($(this).attr("id")) == "true") {
$(this).prop("checked", true);
} else if (($.cookie($(this).attr("id")) == "false")) {
} else {
$(this).prop("checked", false);
}