title: Cannot append image with jquery
body: <p>I currently have a code working where i can add a class based on the url of a page using jquery. However I would like add an image to a div instead of just adding a class. I'm not as proficient in java-script as I could be but I think there is probably a pretty simple solution.  The code that doesn't work is </p>
  
  <pre><code>if (window.location.href.indexOf('Locate_an_eyecare_professional') &gt; -1) {
          var img = document.createElement("img");
          img.src = '~/Content/Images/Template 5A Filmstrip.jpg" /&gt;';
  
  
  
      }
  </code></pre>
  
  <p>the code that works right now that I dont want to use is </p>
  
  <pre><code>if (window.location.href.indexOf('Locate_an_eyecare_professional') &gt; -1) {
          var $body = $('body');
  
          $body.addClass('campaign');
  
  
      }
  </code></pre>
  
  <p>How can apply what I do know that works to what I am trying to get to work?</p>