Skip welcome & menu and move to editor
Welcome to JS Bin
Load cached copy from
 
<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <title>Toggle Button</title>
</head>
<body>
  <label class="toggle-button">
    <input type="radio" name="bloodtype" value="O">
    <span class="label">O</span>
  </label>
  <label class="toggle-button">
    <input type="radio" name="bloodtype" value="A">
    <span class="label">A</span>
  </label>
  <label class="toggle-button">
    <input type="radio" name="bloodtype" value="B">
    <span class="label">B</span>
  </label>
  <label class="toggle-button">
    <input type="radio" name="bloodtype" value="AB">
    <span class="label">AB</span>
  </label>
  
</body>
</html>
 
.toggle-button input[type=radio] {
  display: none;
}
.toggle-button .label {
  display: inline-block;
  padding: .3em .6em;
  background-color: lightgray;
  border-radius: .3em;
}
.toggle-button :checked + .label {
  background-color: magenta;
  color: #fff;
}
Output 300px

You can jump to the latest bin by adding /latest to your URL

Dismiss x
public
Bin info
mach3pro
0viewers