두 번째 확인란을 클릭하면 첫 번째 확인란이 활성화됩니다.원하는 확인란이 활성화되지 않음
하지만 첫 번째 확인란을 클릭하면 모든 것이 정상적으로 작동합니다.
두 번째 확인란을 클릭하고 무슨 일이 일어나는지 확인하십시오.
1000 개의 확인란이 있습니다.변경 ID는 좋지 않습니다!
자세한 내용이 필요하면 질문에 대한 의견을 말하십시오.
.checkboxFour{
\t width: 14px;
\t height: 14px;
\t background: #dddddd;
\t margin: 0px 0px;
\t border-radius: 100%;
\t position: absolute;
\t margin-top: -20px;
\t margin-right: -18px;
}
.checkboxFour > input{visibility: hidden;/* position: absolute; *//* z-index:-1000; *//* overflow: hidden; *//* clip: rect(0 0 0 0); */height: 17px;width: 14px;margin: -2px;margin-right: -7px;padding:0;border:0;}
.checkboxFour label{
\t width: 10px;
\t height: 10px;
\t border-radius: 100px;
\t transition: all .5s ease;
\t cursor: pointer;
\t top: 0px;
\t position: absolute;
\t left: 2px;
\t z-index: 1;
\t background: #ddd;
\t margin-top: 2px;
\t margin-right: 2px;
}
.checkboxFour input[type=checkbox]:checked + label {
\t background: #f83232;
}
<br>
<br>
<br>
<td><div class="checkboxFour"><input type="checkbox" value="1" id="checkboxFourInput" name=""><label for="checkboxFourInput"> </label> Important</div></td>
<br><br><br><br><br>
<td><div class="checkboxFour"><input type="checkbox" value="1" id="checkboxFourInput" name=""><label for="checkboxFourInput"> </label> </div>Not Important</td>
감사합니다 :
은 여기 봐주십시오 코드입니다!
"변경 ID는 좋지 않습니다."- 네, 맞습니다. – Quentin
모든 요소마다 고유 ID가 필요합니다. 동적 ID –