Skip welcome & menu and move to editor
Welcome to JS Bin
Load cached copy from
 
<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <title>JS Bin</title>
</head>
<body>
  
  <p>Tabindex causes input to miss click events.</p>
  <ul>
    <li>A click on the checkbox select the checkbox ✅</li>
    <li>A click on the light-blue label selects the checkbox ✅</li>
    <li>A click on the dark-blue area doesn't select the checkbox. ❌ </li>
  </ul>
  
  <label>
    <span class="checkbox-container" tabindex="1">
      <input type="checkbox"/>
    </span>
    Label
  </label>
  
</body>
</html>
 
label {
  background: rgba(0, 0, 255, 0.2);
  border: 1px solid blue;
}
.checkbox-container {
  background: rgba(0, 0, 255, 0.4);
  padding-left: 20px;
  padding-right: 20px;
}
Output

This bin was created anonymously and its free preview time has expired (learn why). — Get a free unrestricted account

Dismiss x
public
Bin info
anonymouspro
0viewers