title: Javascript won't work with the html
body: <p>So i'm having a problem here, when i'm using jsbin it all works fine with the javascript, html and the css where they all manage to work together. But since it's better and easier to work in brackets or sublime text 2 i tried to use them. And first i couldn't get the javascript to work together with the html even though i connected them both correctly. I even tried putting all the javascript code inside a script tag in the html as you can see here: </p>
  
  <pre><code> &lt;html&gt;
      &lt;head&gt;
        &lt;meta charset="utf-8"&gt;
        &lt;meta name="viewport" content="width=device-width"&gt;
        &lt;title&gt;JS Bin&lt;/title&gt;
  
      &lt;link rel="stylesheet" type="text/css" href="css1.css"&gt;
      &lt;/head&gt;
  
      &lt;body  background="https://guideinparadise.files.wordpress.com/2013/01/down-below2.jpg"&gt;
        &lt;h1&gt;Fiskaren&lt;/h1&gt;
        &lt;img id="fiskespo" src ="https://pixabay.com/static/uploads/photo/2014/03/24/17/07/fishing-rod-295096_960_720.png"&gt;
      &lt;p&gt;Sekunder:&lt;/p&gt;
        &lt;p id="klocka"&gt;&lt;/p&gt; 
  
  
          &lt;script&gt; 
              document.body.style.cursor = 'none'; // tar bort muspekaren
      (document).mousemove(function (e) { //gör en funktion för musen
         ('#fiskespo').offset({  // tar fram bilden
              left: e.pageX + -190,  //positonerar musen på bilden
              top: e.pageY + -110//positonerar musen på bilden
          });
      });
  
       var b = 1; 
        for (var i= 0; i&lt;5;i++){ // skapar en loop som skriver ut 5 stycken bilder på fiskar
        fisk(b);
        }
      function getRandomPosition(element) {
          var x = document.body.offsetHeight-element.clientHeight;
          var y = document.body.offsetWidth-element.clientWidth;
          var randomX = Math.floor(Math.random()*x);
          var randomY = Math.floor(Math.random()*y);
  
          return [randomX,randomY];   
      } 
      function fisk(skala) { 
  
          var img = document.createElement('img');
          img.setAttribute("style", "position:fixed;");//positionerar dom
          img.setAttribute("src", "http://i.imgur.com/K9egEbW.jpg"); // tar fram bilderna
          document.body.appendChild(img); 
          var xy = getRandomPosition(img); // ger xy random position
          img.style.top = xy[0] + 'px';// gör att de ej kan flyttas från ruta 1
          img.style.left = xy[1] + 'px';
         $(img).click(function(){ $(this).remove();}); //skapar en onclick funktion som gör så att om man klickar på bilden försvinner den
  
      }
        myTimer = setInterval(myCounter, 1000); //bestämmer hur lång tiden ska vara (1000 = 1 vanlig sekund)
        var seconds = 0; //sekunden den börjar på
        function myCounter() {
          document.getElementById("klocka").innerHTML = ++seconds; //räknar klockan i sekunder
      }   
  &lt;/script&gt;
      &lt;/body&gt;
      &lt;/html&gt;
  </code></pre>
  
  <p>And this didn't work either. And i find this really wierd since it works on jsbin but not on a better program. Anybody have a clue on what i might be missing or if there is problems with the programs i'm using. Here is the css code aswell if you want to take a look at it all together. </p>
  
  <pre><code>#fiskespo{
    width: 120px;
   z-index: 2;
  
  }
  
  body{
    background-size: 100%;
  
  }
  
  h1{
    font-size: 60px;
    font-family: cursive;
    color: red;
    z-index: 3;
  
  }
  
  p{
    font-size: 40px;
    position: relative;
    top: -260px;
    z-index: 3;
  
  }
  </code></pre>
  
  <p>Thanks.</p>