title: jQuery: Fade in image while mouse over, fade out when mouse out
body: <p>This should be pretty simple. Just can't get it right. I want my webpage to load images with 50% opacity. Then, on mouseover riase the opacity to 1, and back down to 0.5 again on mouseout.</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;!DOCTYPE html&gt;
  &lt;html lang='no'&gt;
  &lt;meta charset ="utf-8"
  &lt;head&gt;
  
  &lt;title&gt;Øving 7&lt;/title&gt;
  
  &lt;style type="text/css"&gt;
  img {
    opacity: 0.5;
  }
  &lt;/style&gt;
  
  &lt;script src="jquery-3.2.1.min.js"&gt;&lt;/script&gt;
  
  &lt;script&gt;
  
  $(document).ready(function() {
  
      $("images").hover(function() {
          $(this).animate({opacity: 1.0}, 500);
      }, function() {
          $(this).animate({opacity: 0.5}, 500);
      });
      });
  
  &lt;/script&gt;
  
  &lt;/head&gt;
  
  &lt;body bgcolor="lightgrey"&gt;
  &lt;h1&gt;Oppgave 1 - jQuery&lt;/h1&gt;
  
  &lt;img class="bild" src="b1.jpg" alt="Bilde1" border="0"/&gt;
  &lt;img class="bild" src="b2.jpg" alt="Bilde2" border="0"/&gt;
  &lt;img class="bild" src="b3.jpg" alt="Bilde3" border="0"/&gt;
  &lt;img class="bild" src="b4.jpg" alt="Bilde4" border="0"/&gt;
  &lt;img class="bild" src="b5.jpg" alt="Bilde5" border="0"/&gt;
  
  
  &lt;/body&gt;
  &lt;/html&gt;</code></pre>
  </div>
  </div>
  </p>