title: How to create div with class
body: <p>I'm trying to create a div and give him a class but it doesn't work.
  Could anybody help me?</p>
  
  <pre><code>$(document).ready(function() {
  $('input[type=checkbox]').each(function() {
      $(this).after($('&lt;div /&gt;', {
          className: 'test',
          text: "a div",
          click: function(e){
              e.preventDefault();
              alert("test")
          }})); 
      });
  });
  </code></pre>
  
  <p>The css:</p>
  
  <pre><code>   .test {
      width:200px;
      height:200px;
      background-color:#eeeeee;
      }
  </code></pre>
  
  <p>at the moment he creates the div but the color isn't #eeeeee</p>