Skip welcome & menu and move to editor
Welcome to JS Bin
Load cached copy from
 
<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width">
    <title>JS Bin</title>
  </head>
  <body class="one two three four">
  </body>
</html>
 
var b = document.body,
    i = 8;
console.log(b.classList.toggle('one')); // false
console.log(b.classList.toggle('two', true)); // true
console.log(b.classList.toggle('three', false)); // false
console.log(b.classList.toggle('four', i < 10)); // true
console.log(b.classList.toggle('five')); // true
console.log(b.classList.toggle('four', i > 10)); // false
Output

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

Dismiss x
public
Bin info
ImpressiveWebspro
0viewers