Skip welcome & menu and move to editor
Welcome to JS Bin
Load cached copy from
 
<!DOCTYPE html>
<html>
<head>
<script src="https://code.jquery.com/jquery-1.11.3.js"></script>
  <meta charset="utf-8">
  <title>JS Bin</title>
</head>
<body>
 <div class="list__item"></div>
</body>
</html>
 
(function () {
  'use strict';
  
  //JS
  window.onload = function () {
    var elem = document.querySelector('.list__item');
    var classNames = elem.className;
    elem.addEventListener('click', function () {
        //elem.classList.add('list__item--active');
        elem.className = classNames + ' list__item--active';        
    }, false);
  };
  //jQuery
  /*
  $(function () {
    $('.list__item').on('click', function () {
       $(this).addClass('list__item--active');
    });
  });
  */
})();
Output

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

Dismiss x
public
Bin info
chekitpro
0viewers