А можно немного упростить
<!DOCTYPE html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<style type="text/css">
.non_used{
background-color:red;
text-align: center;
width: 300px;
font-size:100px;
}
.used{
background-color: yellow;
text-align: center;
width: 300px;
font-size:100px;
color: red;
}
</style>
<script type="text/javascript">
function test(elem){
if(elem.classList.contains("non_used")){
elem.classList.remove("non_used");
elem.classList.add("used");
}else{
elem.classList.remove("used");
elem.classList.add("non_used");
};
}
</script>
</head>
<div class="non_used" onclick="test(this)">000</div>
<div class="non_used" onclick="test(this)">111</div>
<div class="non_used" onclick="test(this)">222</div>
<div class="used" onclick="test(this)">333</div>