Skip welcome & menu and move to editor
Welcome to JS Bin
Load cached copy from
 
<!DOCTYPE html>
<html>
<head>
<script src="http://code.jquery.com/jquery-git2.js"></script>
<meta charset=utf-8 />
<title>JS Bin</title>
</head>
<body>
  <br><br><br>
  <div>
  <label>
  <input type="checkbox" class="ch" />
    test
  </label>
  <label>
  <input type="checkbox" class="ch" />
    test
  </label>
      <label>
  <input type="checkbox" class="ch" />
    test
  </label>
    <br><br><br>
  <input type="button" value="check the box" id="select" />
  </div>
</body>
</html>
 
$("body").on("change", ".ch", function(){
  
  alert("checked");
  
});
$("body").on("click", "#select", function(){
  
  $(this).parent("div").find("input[type=checkbox]").prop("checked", true).change();
  
});
Output 300px

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

Dismiss x
public
Bin info
anonymouspro
0viewers