Skip welcome & menu and move to editor
Welcome to JS Bin
Load cached copy from
 
<!DOCTYPE html>
<html>
<head>
<meta charset=utf-8 />
<title>DOM0 Checkbox Change Event Example</title>
  <style>
    body {
      font-family: sans-serif;
    }
  </style>
</head>
<body>
  <p>Note how <code>change</code> fires immediately on most browsers, but not until focus leaves the checkbox on IE.</p>
  <input type="checkbox" onchange="handleChange(this);">
</body>
</html>
 
function handleChange(cb) {
  display("Changed, new value = " + cb.checked);
}
function display(msg) {
  var p = document.createElement('p');
  p.innerHTML = msg;
  document.body.appendChild(p);
}
Output 300px

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

Dismiss x
public
Bin info
anonymouspro
0viewers