title: "Uncaught TypeError: undefined is not a function " jQuery each function issue
body: <p>This is a pretty basic question. I have this block of code which I thought was OK but its throwing up an error...</p>
  
  <pre><code>Uncaught TypeError: undefined is not a function 
  </code></pre>
  
  <p>Here is the code in question</p>
  
  <pre><code>$('.colourbox').each(function(i){
  // select visible children
  var visibleDivs = $(this).children('div').length;
  
  // use whatever width calculation you'd like...
  var targetWidth = 300 / visibleDivs.length - 1;
  
  // apply the width to the divs
  visibleDivs.width(targetWidth);
  });
  </code></pre>
  
  <p>Thanks</p>