title: Issue with running a JavaScript function build wih jQuery
body: <p>I have a function</p>
  
  <pre><code>function imageDefer() {
     $('img').each(function(){
        $(this).attr('src', $(this).attr('data-defer'));
     });
  }
  </code></pre>
  
  <p>Now I want to run this function this way</p>
  
  <pre><code>$(document).ready(function () {
      imageDefer();
  });
  </code></pre>
  
  <p>Here is my html</p>
  
  <pre><code>&lt;img src="data:image/png;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs=" data-defer="thumbnail.jpg"&gt;
  </code></pre>
  
  <p>JavaScript and jQuery code is placed in separate .js file but it does work.</p>